Struct safe_index::examples::clients::Data [−][src]
pub struct Data { pub clients: Clients<ClientInfo>, pub files: Files<FileInfo>, }
Aggregates client and file info.
Fields
clients: Clients<ClientInfo>
Map from client indexes to client information.
files: Files<FileInfo>
Map from file indexes to file information.
Implementations
impl Data
[src]
impl Data
[src]pub fn new() -> Data
[src]
Constructor.
pub fn add_client<S: Into<String>>(&mut self, name: S) -> Client
[src]
Adds a client.
Does not add the client again if it’s already there (by name).
pub fn add_file(&mut self, file: FileInfo) -> File
[src]
Adds a file, updates the clients concerned.
pub fn get_file(&mut self, file: File) -> &FileInfo
[src]
Retrieves information about a file.
pub fn add_client_to_file(&mut self, client: Client, file: File)
[src]
Adds a client to a file.
pub fn client_clusters(&self) -> Vec<(ClientSet, FileSet)>ⓘ
[src]
Returns the client equivalence classes.
Two clients are in the same equivalence class if they are associated to the same file, transitively.
Trait Implementations
impl Index<Client> for Data
[src]
impl Index<Client> for Data
[src]type Output = ClientInfo
The returned type after indexing.
fn index(&self, client: Client) -> &ClientInfo
[src]
Auto Trait Implementations
impl RefUnwindSafe for Data
impl RefUnwindSafe for Data
impl UnwindSafe for Data
impl UnwindSafe for Data