pub struct AtLogin {
pub program: Option<PathBuf>,
pub libraries: Vec<Served>,
}Expand description
The list of libraries to sync from login, and the copy of nibkeep-sync that serves
them.
Fields§
§program: Option<PathBuf>The copy of nibkeep-sync that serves them, which the login entry starts.
libraries: Vec<Served>The libraries.
Implementations§
Source§impl AtLogin
impl AtLogin
Sourcepub fn read(settings: &Path) -> Result<Self, NodeError>
pub fn read(settings: &Path) -> Result<Self, NodeError>
Reads the list in the folder of settings: empty if there is none.
§Errors
Returns an error if the list cannot be read, or does not read as a list.
Sourcepub fn edit<T>(
settings: &Path,
change: impl FnOnce(&mut Self) -> T,
) -> Result<T, NodeError>
pub fn edit<T>( settings: &Path, change: impl FnOnce(&mut Self) -> T, ) -> Result<T, NodeError>
Changes the list as change does, and writes it if it changed: while holding the
lock on sync-at-login.lock, so that two programs never undo each other’s changes.
Returns what change returns.
§Errors
Returns an error if the list cannot be read, locked or written, or names a path that is not Unicode.
Sourcepub fn add(&mut self, served: Served)
pub fn add(&mut self, served: Served)
Adds a library, in place of any with its directory or replica.
Sourcepub fn remove(&mut self, directory: &Path) -> bool
pub fn remove(&mut self, directory: &Path) -> bool
Removes the library in directory: whether the list had it.
Sourcepub fn remove_replica(&mut self, replica: EntityId) -> bool
pub fn remove_replica(&mut self, replica: EntityId) -> bool
Removes the library whose replica on this computer is replica: whether the list had
it.
Trait Implementations§
impl Eq for AtLogin
impl StructuralPartialEq for AtLogin
Auto Trait Implementations§
impl Forget for AtLogin
impl Freeze for AtLogin
impl Move for AtLogin
impl RefUnwindSafe for AtLogin
impl Send for AtLogin
impl Sync for AtLogin
impl Unpin for AtLogin
impl UnsafeUnpin for AtLogin
impl UnwindSafe for AtLogin
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.