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]

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)>

Notable traits for Vec<u8, A>

impl<A> Write for Vec<u8, A> where
    A: Allocator
[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 RefUnwindSafe for Data

impl Send for Data

impl Sync for Data

impl Unpin for Data

impl UnwindSafe for Data

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.