pub struct NewLibrary<'a> {
pub user: &'a str,
pub person: Option<&'a str>,
pub device: &'a str,
pub app: &'a str,
pub languages: Languages,
}Expand description
Who and where a new library starts: the user’s name, and the person’s, the user’s own entity among the people, if it differs; this device’s name, and the name of the app that keeps the replica; and the languages the user reads, ranked.
Fields§
§user: &'a strThe user’s name.
person: Option<&'a str>The name of the person the user is, if not the user’s, such as a full name beside an account’s name.
device: &'a strThis device’s name.
app: &'a strThe app’s name, which the replica gets.
languages: LanguagesThe languages the user reads, ranked; none if empty.
Implementations§
Source§impl<'a> NewLibrary<'a>
impl<'a> NewLibrary<'a>
Sourcepub fn new(user: &'a str, device: &'a str, app: &'a str) -> Self
pub fn new(user: &'a str, device: &'a str, app: &'a str) -> Self
A new library for a user on a device, kept by an app, without languages.
Sourcepub fn with_person(self, person: Option<&'a str>) -> Self
pub fn with_person(self, person: Option<&'a str>) -> Self
The same, with the person the user is named apart from the user, if a name is given.
Sourcepub fn with_languages(self, languages: Languages) -> Self
pub fn with_languages(self, languages: Languages) -> Self
The same, with the languages the user reads.
Trait Implementations§
Source§impl<'a> Clone for NewLibrary<'a>
impl<'a> Clone for NewLibrary<'a>
Source§impl<'a> Debug for NewLibrary<'a>
impl<'a> Debug for NewLibrary<'a>
impl<'a> Eq for NewLibrary<'a>
Source§impl<'a> PartialEq for NewLibrary<'a>
impl<'a> PartialEq for NewLibrary<'a>
impl<'a> StructuralPartialEq for NewLibrary<'a>
Auto Trait Implementations§
impl<'a> Forget for NewLibrary<'a>
impl<'a> Freeze for NewLibrary<'a>
impl<'a> Move for NewLibrary<'a>
impl<'a> RefUnwindSafe for NewLibrary<'a>
impl<'a> Send for NewLibrary<'a>
impl<'a> Sync for NewLibrary<'a>
impl<'a> Unpin for NewLibrary<'a>
impl<'a> UnsafeUnpin for NewLibrary<'a>
impl<'a> UnwindSafe for NewLibrary<'a>
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.