[][src]Struct safe_index::examples::clients::Data

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.

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.

Auto Trait Implementations

impl Send for Data

impl Sync for Data

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]