pub struct RoleHierarchyTree {
pub root: RoleNode,
pub total_roles: usize,
pub max_depth: usize,
pub metadata: HierarchyMetadata,
}Expand description
Represents a complete role hierarchy tree structure.
This type provides a structured view of role relationships that can be used for visualization, API responses, or external system integration.
§Example
let storage = MemoryStorage::new();
let role_sys = RoleSystem::with_storage(storage, RoleSystemConfig::default());
let role_system = AsyncRoleSystem::new(role_sys);
// Get hierarchy tree from role system
let tree = role_system.get_hierarchy_tree(None).await?;
println!("Total roles: {}, Max depth: {}", tree.total_roles, tree.max_depth);Fields§
§root: RoleNodeRoot node of the hierarchy tree
total_roles: usizeTotal number of roles in the tree
max_depth: usizeMaximum depth of the hierarchy
metadata: HierarchyMetadataMetadata about the tree structure
Implementations§
Trait Implementations§
Source§impl Clone for RoleHierarchyTree
impl Clone for RoleHierarchyTree
Source§fn clone(&self) -> RoleHierarchyTree
fn clone(&self) -> RoleHierarchyTree
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RoleHierarchyTree
impl !RefUnwindSafe for RoleHierarchyTree
impl Send for RoleHierarchyTree
impl Sync for RoleHierarchyTree
impl Unpin for RoleHierarchyTree
impl !UnwindSafe for RoleHierarchyTree
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more