pub struct FileIdentity { /* private fields */ }Expand description
Stable identity supplied by a filesystem backend when available.
provider namespaces opaque identity bytes. Empty provider/value components
are accepted, and multiple nodes may intentionally share an identity (for
example hard links).
§Examples
use ailloli_ui_fs::FileIdentity;
let identity = FileIdentity::new("local", 42_u64.to_le_bytes());
assert_eq!(identity.provider(), "local");Implementations§
Source§impl FileIdentity
impl FileIdentity
Sourcepub fn new(provider: impl Into<String>, value: impl Into<Vec<u8>>) -> Self
pub fn new(provider: impl Into<String>, value: impl Into<Vec<u8>>) -> Self
Stores a provider namespace and opaque bytes verbatim.
§Examples
use ailloli_ui_fs::FileIdentity;
let identity = FileIdentity::new("", Vec::<u8>::new());
assert!(identity.provider().is_empty() && identity.value().is_empty());Trait Implementations§
Source§impl Clone for FileIdentity
impl Clone for FileIdentity
Source§fn clone(&self) -> FileIdentity
fn clone(&self) -> FileIdentity
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FileIdentity
impl Debug for FileIdentity
Source§impl<'de> Deserialize<'de> for FileIdentity
impl<'de> Deserialize<'de> for FileIdentity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Hash for FileIdentity
impl Hash for FileIdentity
Source§impl PartialEq for FileIdentity
impl PartialEq for FileIdentity
Source§impl Serialize for FileIdentity
impl Serialize for FileIdentity
impl Eq for FileIdentity
impl StructuralPartialEq for FileIdentity
Auto Trait Implementations§
impl Freeze for FileIdentity
impl RefUnwindSafe for FileIdentity
impl Send for FileIdentity
impl Sync for FileIdentity
impl Unpin for FileIdentity
impl UnwindSafe for FileIdentity
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