pub struct Table<T> { /* private fields */ }Expand description
The sessions this instance is holding.
Implementations§
Source§impl<T> Table<T>
impl<T> Table<T>
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
Whether this instance is holding nothing, which is half of concept 8’s exit rule.
Sourcepub fn insert(&mut self, container: &Path, held: T) -> Result<()>
pub fn insert(&mut self, container: &Path, held: T) -> Result<()>
Take a session in, keyed on what container is now.
§Errors
Where the container’s identity cannot be established.
Sourcepub fn find_mut(&mut self, container: &Path) -> Option<&mut T>
pub fn find_mut(&mut self, container: &Path) -> Option<&mut T>
The session already open on this container, if there is one.
A container that is not there matches nothing rather than failing: an invocation naming a path that does not exist has a different problem, and it is not this function’s to report.
Sourcepub fn refresh(&mut self, container: &Path)
pub fn refresh(&mut self, container: &Path)
Re-read the identity of a session’s container.
Called after a write-back, which renamed a new file over the container and so gave it a new inode. Without this the entry keeps matching by path and stops matching by identity, which quietly loses the hard-link half of the guarantee for the rest of the session.
A container that has gone keeps the identity it had. There is nothing better to record, and the path arm still finds the session so that the person can be told.