var searchIndex = {}; searchIndex["users"] = {"doc":"This is a library for getting information on Unix users and groups. It\nsupports getting the system users, and creating your own mock tables.","items":[[6,"uid_t","users","",null,null],[6,"gid_t","","",null,null],[3,"User","","Information about a particular user.",null,null],[12,"name_arc","","This user’s name, as an owned `String` possibly shared with a cache.\nPrefer using the `name()` accessor to using this field, if possible.",0,null],[3,"Group","","Information about a particular group.",null,null],[12,"name_arc","","This group’s name, as an owned `String` possibly shared with a cache.\nPrefer using the `name()` accessor to using this field, if possible.",1,null],[3,"AllUsers","","An iterator over every user present on the system.",null,null],[5,"get_user_by_uid","","Searches for a `User` with the given ID in the system’s user database.\nReturns it if one is found, otherwise returns `None`.",null,{"inputs":[{"name":"uid_t"}],"output":{"name":"option"}}],[5,"get_user_by_name","","Searches for a `User` with the given username in the system’s user database.\nReturns it if one is found, otherwise returns `None`.",null,{"inputs":[{"name":"str"}],"output":{"name":"option"}}],[5,"get_group_by_gid","","Searches for a `Group` with the given ID in the system’s group database.\nReturns it if one is found, otherwise returns `None`.",null,{"inputs":[{"name":"gid_t"}],"output":{"name":"option"}}],[5,"get_group_by_name","","Searches for a `Group` with the given group name in the system’s group database.\nReturns it if one is found, otherwise returns `None`.",null,{"inputs":[{"name":"str"}],"output":{"name":"option"}}],[5,"get_current_uid","","Returns the user ID for the user running the process.",null,{"inputs":[],"output":{"name":"uid_t"}}],[5,"get_current_username","","Returns the username of the user running the process.",null,{"inputs":[],"output":{"name":"option"}}],[5,"get_effective_uid","","Returns the user ID for the effective user running the process.",null,{"inputs":[],"output":{"name":"uid_t"}}],[5,"get_effective_username","","Returns the username of the effective user running the process.",null,{"inputs":[],"output":{"name":"option"}}],[5,"get_current_gid","","Returns the group ID for the user running the process.",null,{"inputs":[],"output":{"name":"gid_t"}}],[5,"get_current_groupname","","Returns the groupname of the user running the process.",null,{"inputs":[],"output":{"name":"option"}}],[5,"get_effective_gid","","Returns the group ID for the effective user running the process.",null,{"inputs":[],"output":{"name":"gid_t"}}],[5,"get_effective_groupname","","Returns the groupname of the effective user running the process.",null,{"inputs":[],"output":{"name":"option"}}],[11,"home_dir","","",0,null],[11,"with_home_dir","","",0,null],[11,"shell","","",0,null],[11,"with_shell","","",0,null],[11,"members","","",1,null],[11,"clone","","",0,null],[11,"new","","Create a new `User` with the given user ID, name, and primary\ngroup ID, with the rest of the fields filled with dummy values.",0,{"inputs":[{"name":"uid_t"},{"name":"str"},{"name":"gid_t"}],"output":{"name":"user"}}],[11,"uid","","Returns this user’s ID.",0,null],[11,"name","","Returns this user’s name.",0,null],[11,"primary_group_id","","Returns the ID of this user’s primary group.",0,null],[11,"fmt","","",0,null],[11,"clone","","",1,null],[11,"new","","Create a new `Group` with the given group ID and name, with the\nrest of the fields filled in with dummy values.",1,{"inputs":[{"name":"gid_t"},{"name":"str"}],"output":{"name":"self"}}],[11,"gid","","Returns this group’s ID.",1,null],[11,"name","","Returns this group's name.",1,null],[11,"fmt","","",1,null],[11,"new","","Creates a new iterator over every user present on the system.",2,{"inputs":[],"output":{"name":"allusers"}}],[11,"drop","","",2,null],[11,"next","","",2,null],[0,"os","","OS-specific extensions to users and groups.",null,null],[0,"unix","users::os","Extensions to users and groups for Unix platforms.",null,null],[3,"UserExtras","users::os::unix","Unix-specific fields for `User`s.",null,null],[12,"home_dir","","The path to the user’s home directory.",3,null],[12,"shell","","The path to the user’s shell.",3,null],[3,"GroupExtras","","Unix-specific fields for `Group`s.",null,null],[12,"members","","Vector of usernames that are members of this group.",4,null],[8,"UserExt","","Unix-specific extensions for `User`s.",null,null],[10,"home_dir","","Returns a path to this user’s home directory.",5,null],[10,"with_home_dir","","Sets this user value’s home directory to the given string.\nCan be used to construct test users, which by default come with a\ndummy home directory string.",5,null],[10,"shell","","Returns a path to this user’s shell.",5,null],[10,"with_shell","","Sets this user’s shell path to the given string.\nCan be used to construct test users, which by default come with a\ndummy shell field.",5,null],[8,"GroupExt","","Unix-specific extensions for `Group`s.",null,null],[10,"members","","Returns a slice of the list of users that are in this group as\ntheir non-primary group.",6,null],[11,"fmt","","",3,null],[11,"clone","","",3,null],[11,"default","","",3,{"inputs":[],"output":{"name":"userextras"}}],[11,"from_passwd","","Extract the OS-specific fields from the C `passwd` struct that\nwe just read.",3,{"inputs":[{"name":"c_passwd"}],"output":{"name":"userextras"}}],[11,"home_dir","users","",0,null],[11,"with_home_dir","","",0,null],[11,"shell","","",0,null],[11,"with_shell","","",0,null],[11,"fmt","users::os::unix","",4,null],[11,"default","","",4,{"inputs":[],"output":{"name":"groupextras"}}],[11,"clone","","",4,null],[11,"from_struct","","Extract the OS-specific fields from the C `group` struct that\nwe just read.",4,{"inputs":[{"name":"c_group"}],"output":{"name":"groupextras"}}],[11,"members","users","",1,null],[6,"UserExtras","users::os","Any extra fields on a `User` specific to the current platform.",null,null],[6,"GroupExtras","","Any extra fields on a `Group` specific to the current platform.",null,null],[0,"cache","users","A cache for users and groups provided by the OS.",null,null],[3,"UsersCache","users::cache","A producer of user and group instances that caches every result.",null,null],[11,"default","","",7,{"inputs":[],"output":{"name":"userscache"}}],[11,"new","","Creates a new empty cache.",7,{"inputs":[],"output":{"name":"userscache"}}],[11,"with_all_users","","Creates a new cache that contains all the users present on the system.",7,{"inputs":[],"output":{"name":"userscache"}}],[11,"get_user_by_uid","","",7,null],[11,"get_user_by_name","","",7,null],[11,"get_current_uid","","",7,null],[11,"get_current_username","","",7,null],[11,"get_effective_uid","","",7,null],[11,"get_effective_username","","",7,null],[11,"get_group_by_gid","","",7,null],[11,"get_group_by_name","","",7,null],[11,"get_current_gid","","",7,null],[11,"get_current_groupname","","",7,null],[11,"get_effective_gid","","",7,null],[11,"get_effective_groupname","","",7,null],[0,"mock","users","Mockable users and groups.",null,null],[6,"uid_t","users::mock","",null,null],[6,"gid_t","","",null,null],[3,"User","","Information about a particular user.",null,null],[12,"name_arc","","This user’s name, as an owned `String` possibly shared with a cache.\nPrefer using the `name()` accessor to using this field, if possible.",0,null],[3,"Group","","Information about a particular group.",null,null],[12,"name_arc","","This group’s name, as an owned `String` possibly shared with a cache.\nPrefer using the `name()` accessor to using this field, if possible.",1,null],[3,"MockUsers","","A mocking users object that you can add your own users and groups to.",null,null],[8,"Users","","Trait for producers of users.",null,null],[10,"get_user_by_uid","","Returns a User if one exists for the given user ID; otherwise, returns None.",8,null],[10,"get_user_by_name","","Returns a User if one exists for the given username; otherwise, returns None.",8,null],[10,"get_current_uid","","Returns the user ID for the user running the process.",8,null],[10,"get_current_username","","Returns the username of the user running the process.",8,null],[10,"get_effective_uid","","Returns the effective user id.",8,null],[10,"get_effective_username","","Returns the effective username.",8,null],[8,"Groups","","Trait for producers of groups.",null,null],[10,"get_group_by_gid","","Returns a Group object if one exists for the given group ID; otherwise, returns None.",9,null],[10,"get_group_by_name","","Returns a Group object if one exists for the given groupname; otherwise, returns None.",9,null],[10,"get_current_gid","","Returns the group ID for the user running the process.",9,null],[10,"get_current_groupname","","Returns the group name of the user running the process.",9,null],[10,"get_effective_gid","","Returns the effective group id.",9,null],[10,"get_effective_groupname","","Returns the effective group name.",9,null],[11,"with_current_uid","","Create a new, empty mock users object.",10,{"inputs":[{"name":"uid_t"}],"output":{"name":"mockusers"}}],[11,"add_user","","Add a user to the users table.",10,null],[11,"add_group","","Add a group to the groups table.",10,null],[11,"get_user_by_uid","","",10,null],[11,"get_user_by_name","","",10,null],[11,"get_current_uid","","",10,null],[11,"get_current_username","","",10,null],[11,"get_effective_uid","","",10,null],[11,"get_effective_username","","",10,null],[11,"get_group_by_gid","","",10,null],[11,"get_group_by_name","","",10,null],[11,"get_current_gid","","",10,null],[11,"get_current_groupname","","",10,null],[11,"get_effective_gid","","",10,null],[11,"get_effective_groupname","","",10,null],[0,"switch","users","Functions for switching the running process’s user or group.",null,null],[3,"SwitchUserGuard","users::switch","Guard returned from a `switch_user_group` call.",null,null],[5,"set_current_uid","","Sets the **current user** for the running process to the one with the\ngiven user ID. Uses `setuid` internally.",null,{"inputs":[{"name":"uid_t"}],"output":{"name":"ioresult"}}],[5,"set_current_gid","","Sets the **current group** for the running process to the one with the\ngiven group ID. Uses `setgid` internally.",null,{"inputs":[{"name":"gid_t"}],"output":{"name":"ioresult"}}],[5,"set_effective_uid","","Sets the **effective user** for the running process to the one with the\ngiven user ID. Uses `seteuid` internally.",null,{"inputs":[{"name":"uid_t"}],"output":{"name":"ioresult"}}],[5,"set_effective_gid","","Sets the **effective group** for the running process to the one with the\ngiven group ID. Uses `setegid` internally.",null,{"inputs":[{"name":"gid_t"}],"output":{"name":"ioresult"}}],[5,"set_both_uid","","Sets both the **current user** and the **effective user** for the running\nprocess to the ones with the given user IDs. Uses `setreuid` internally.",null,{"inputs":[{"name":"uid_t"},{"name":"uid_t"}],"output":{"name":"ioresult"}}],[5,"set_both_gid","","Sets both the **current group** and the **effective group** for the\nrunning process to the ones with the given group IDs. Uses `setregid`\ninternally.",null,{"inputs":[{"name":"gid_t"},{"name":"gid_t"}],"output":{"name":"ioresult"}}],[5,"switch_user_group","","Sets the **effective user** and the **effective group** for the current\nscope.",null,{"inputs":[{"name":"uid_t"},{"name":"gid_t"}],"output":{"name":"ioresult"}}],[11,"drop","","",11,null],[8,"Users","users","Trait for producers of users.",null,null],[10,"get_user_by_uid","","Returns a User if one exists for the given user ID; otherwise, returns None.",8,null],[10,"get_user_by_name","","Returns a User if one exists for the given username; otherwise, returns None.",8,null],[10,"get_current_uid","","Returns the user ID for the user running the process.",8,null],[10,"get_current_username","","Returns the username of the user running the process.",8,null],[10,"get_effective_uid","","Returns the effective user id.",8,null],[10,"get_effective_username","","Returns the effective username.",8,null],[8,"Groups","","Trait for producers of groups.",null,null],[10,"get_group_by_gid","","Returns a Group object if one exists for the given group ID; otherwise, returns None.",9,null],[10,"get_group_by_name","","Returns a Group object if one exists for the given groupname; otherwise, returns None.",9,null],[10,"get_current_gid","","Returns the group ID for the user running the process.",9,null],[10,"get_current_groupname","","Returns the group name of the user running the process.",9,null],[10,"get_effective_gid","","Returns the effective group id.",9,null],[10,"get_effective_groupname","","Returns the effective group name.",9,null],[11,"fmt","users::os::unix","",3,null],[11,"clone","","",3,null],[11,"default","","",3,{"inputs":[],"output":{"name":"userextras"}}],[11,"from_passwd","","Extract the OS-specific fields from the C `passwd` struct that\nwe just read.",3,{"inputs":[{"name":"c_passwd"}],"output":{"name":"userextras"}}],[11,"fmt","","",4,null],[11,"default","","",4,{"inputs":[],"output":{"name":"groupextras"}}],[11,"clone","","",4,null],[11,"from_struct","","Extract the OS-specific fields from the C `group` struct that\nwe just read.",4,{"inputs":[{"name":"c_group"}],"output":{"name":"groupextras"}}]],"paths":[[3,"User"],[3,"Group"],[3,"AllUsers"],[3,"UserExtras"],[3,"GroupExtras"],[8,"UserExt"],[8,"GroupExt"],[3,"UsersCache"],[8,"Users"],[8,"Groups"],[3,"MockUsers"],[3,"SwitchUserGuard"]]}; initSearch(searchIndex);