pub async fn create_group<'a>(
virtual_file_system: &'a VirtualFileSystem<'a>,
group_name: &str,
group_identifier: Option<GroupIdentifier>,
) -> Result<GroupIdentifier>
Expand description
Creates a new group with the specified parameters.
This function creates a new group in the system by:
- Generating a new group identifier (if not provided)
- Adding the group to the Users manager
- Creating the group file with the group data
The group is created with an empty user list initially.
§Arguments
Virtual_file_system
- Reference to the virtual file systemGroup_name
- Name for the new groupGroup_identifier
- Optional specific group identifier (auto-generated if None)
§Returns
Returns Ok(Group_identifier_type)
with the new group’s identifier,
or an appropriate error if creation fails.
§Errors
This function can fail for various reasons including:
- Group identifier generation or assignment failures
- File system operations (directory creation, file writing)
- Users manager operations (adding group)