[−][src]Struct safe_index::examples::clients::Data
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.
Methods
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]
type Output = ClientInfo
The returned type after indexing.
fn index(&self, client: Client) -> &ClientInfo
[src]
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,