pub struct RecordRef {
pub did: String,
pub collection: String,
pub rkey: Option<String>,
}Expand description
What a reader addresses: a DID, a collection, and either one record key or the whole collection.
The authority is a DID and never a handle. A handle moves between accounts and a preference or a gate belongs to the account rather than to the name it currently answers to, so the cache is keyed by DID throughout and a caller holding a handle resolves it before it gets here.
A reference with no rkey reads the collection, which is what a
policy’s lookup naming no record key asks for.
Fields§
§did: StringThe repository’s DID.
collection: StringThe collection (NSID) the record is in.
rkey: Option<String>The record key, or None for every record in the collection.
Implementations§
Source§impl RecordRef
impl RecordRef
Sourcepub fn new(
did: impl Into<String>,
collection: impl Into<String>,
rkey: impl Into<String>,
) -> Self
pub fn new( did: impl Into<String>, collection: impl Into<String>, rkey: impl Into<String>, ) -> Self
A reference to rkey in collection in did’s repository.
Sourcepub fn collection(did: impl Into<String>, collection: impl Into<String>) -> Self
pub fn collection(did: impl Into<String>, collection: impl Into<String>) -> Self
A reference to every record in collection in did’s repository.
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Whether this names the whole collection rather than one record.
Trait Implementations§
impl Eq for RecordRef
impl StructuralPartialEq for RecordRef
Auto Trait Implementations§
impl Freeze for RecordRef
impl RefUnwindSafe for RecordRef
impl Send for RecordRef
impl Sync for RecordRef
impl Unpin for RecordRef
impl UnsafeUnpin for RecordRef
impl UnwindSafe for RecordRef
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.