pub struct Resource { /* private fields */ }Expand description
A storage-level component used to realize a representation.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn new(
id: ResourceId,
fingerprints: Vec<ResourceFingerprint>,
file_facts: Option<FileFacts>,
) -> Self
pub fn new( id: ResourceId, fingerprints: Vec<ResourceFingerprint>, file_facts: Option<FileFacts>, ) -> Self
Creates a resource from content evidence known at observation time.
Sourcepub const fn id(&self) -> ResourceId
pub const fn id(&self) -> ResourceId
Returns the resource’s stable identity.
Sourcepub fn fingerprints(&self) -> &[ResourceFingerprint]
pub fn fingerprints(&self) -> &[ResourceFingerprint]
Returns stored content identity evidence.
Sourcepub const fn file_facts(&self) -> Option<FileFacts>
pub const fn file_facts(&self) -> Option<FileFacts>
Returns cheap stored file facts, when available.
Sourcepub fn with_observed_fingerprint(
&self,
fingerprint: &ResourceFingerprint,
) -> Self
pub fn with_observed_fingerprint( &self, fingerprint: &ResourceFingerprint, ) -> Self
Returns this resource with fingerprint as the current observation in
its algorithm/version domain, replacing any value in that domain.
Trait Implementations§
impl Eq for Resource
impl StructuralPartialEq for Resource
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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