I am trying to do something similar but running into problems, so this is not an answer but a question about a slightly more advanced usage of this script.
I am also trying to rotate bmesh around Vector, but I only want to rotate the selected faces, not the whole mesh, around the Active Edge. Also, before that, I want to do an extrusion with 0 distance, so that the rotation kind of has a new segment. My problem is that I get this extra geometry. I read that I am supposed to delete the geometry that bmesh.ops.extrude_face_region() uses to make new geometry. I have tried that as well but blender crashes every time when I use bmesh.ops.delete(). So I have that part commented out in my script. Could anyone help me avoid the weird extra geometry when using this script. Again, this will work with copy-past into the Text Editor and Run Script, while having a mesh in Edit mode with one Active Edge. 
import bpy
import bmesh
context = bpy.context
from mathutils import Matrix
from math import radians
obj = context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
selected = [v for v in bm.verts if v.select]
face_sel = [f for f in bm.faces if f.select]
edge = bm.select_history.active
axis_rot = (edge.verts[0].co - edge.verts[1].co).normalized()
rot = Matrix.Rotation(radians(45), 4, axis_rot)
r = bmesh.ops.extrude_face_region(bm, geom=face_sel)
# DEL_VERTS = 1
# DEL_EDGES = 2
# DEL_ONLYFACES = 3
# DEL_EDGESFACES = 4
# DEL_FACES = 5
# DEL_ALL = 6
# DEL_ONLYTAGGED = 7
# bmesh.ops.delete(bm, geom=face_sel, context=DEL_FACES)
bmesh.ops.rotate(bm, cent=edge.verts[0].co, matrix=rot, verts=selected)
me.update()
max(vec)
( assume here:want a unit vector for that onevec.normalized()
)Euler(vec)
is not gong to give any sensible rotation matrix, considering for a start the vec is in length units, the euler expects angles.rot = Matrix.Rotation(angle, size, axis)
might be a better idea. $\endgroup$