pub struct IdentityReading { /* private fields */ }Expand description
What one read of a volume’s identity produced: the identity itself, and the assurance of the read that produced it.
This is what volume_identity() returns, and the pairing is the point —
the value cannot be taken without the level it was read at being in hand.
The identity inside is the durable key: two readings of one volume on two
platforms carry the same VolumeIdentity and, usually, different
assurances, so it is identity() that goes into a registry and the
assurance that decides whether to write to it now.
Implementations§
Source§impl IdentityReading
impl IdentityReading
Sourcepub const fn identity(&self) -> VolumeIdentity
pub const fn identity(&self) -> VolumeIdentity
The identity the volume is named by — the durable key, whatever it was read from.
Sourcepub const fn assurance(&self) -> IdentityAssurance
pub const fn assurance(&self) -> IdentityAssurance
How this identity was obtained.
Sourcepub const fn is_vouched(&self) -> bool
pub const fn is_vouched(&self) -> bool
Whether the identity was read from the mounted filesystem itself on this
call — shorthand for assurance() == IdentityAssurance::Vouched, so that
requiring it is one call: volume_identity().filter(IdentityReading::is_vouched).
Sourcepub const fn is_declared(&self) -> bool
pub const fn is_declared(&self) -> bool
Whether the identity was read through a mount source its own mounter
chose — shorthand for assurance() == IdentityAssurance::Declared, so
that refusing it is one call:
volume_identity().filter(|r| !r.is_declared()).
A consumer that mints or recognizes a volume by what it reads should
refuse this level. See Declared.