Trait atrium_api::types::Collection
source · pub trait Collection: Debug {
type Record: Debug + DeserializeOwned + Serialize;
const NSID: &'static str;
// Provided methods
fn nsid() -> Nsid { ... }
fn repo_path(rkey: &RecordKey) -> String { ... }
}
Expand description
Trait for a collection of records that can be stored in a repository.
The records all have the same Lexicon schema.
Required Associated Types§
sourcetype Record: Debug + DeserializeOwned + Serialize
type Record: Debug + DeserializeOwned + Serialize
This collection’s record type.
Required Associated Constants§
Provided Methods§
sourcefn nsid() -> Nsid
fn nsid() -> Nsid
Returns the Nsid
for the Lexicon that defines the schema of records in this
collection.
This is a convenience method that parses Self::NSID
.
§Panics
Panics if Self::NSID
is not a valid NSID.
sourcefn repo_path(rkey: &RecordKey) -> String
fn repo_path(rkey: &RecordKey) -> String
Returns the repo path for a record in this collection with the given record key.
Per the Repo Data Structure v3 specification:
Repo paths currently have a fixed structure of
<collection>/<record-key>
. This means a valid, normalizedNsid
, followed by a/
, followed by a validRecordKey
.
Object Safety§
This trait is not object safe.
Implementors§
source§impl Collection for Profile
Available on crate feature namespace-appbsky
only.
impl Collection for Profile
Available on crate feature
namespace-appbsky
only.source§impl Collection for Generator
Available on crate feature namespace-appbsky
only.
impl Collection for Generator
Available on crate feature
namespace-appbsky
only.source§impl Collection for Like
Available on crate feature namespace-appbsky
only.
impl Collection for Like
Available on crate feature
namespace-appbsky
only.source§impl Collection for Post
Available on crate feature namespace-appbsky
only.
impl Collection for Post
Available on crate feature
namespace-appbsky
only.source§impl Collection for Repost
Available on crate feature namespace-appbsky
only.
impl Collection for Repost
Available on crate feature
namespace-appbsky
only.source§impl Collection for Threadgate
Available on crate feature namespace-appbsky
only.
impl Collection for Threadgate
Available on crate feature
namespace-appbsky
only.source§impl Collection for Block
Available on crate feature namespace-appbsky
only.
impl Collection for Block
Available on crate feature
namespace-appbsky
only.source§impl Collection for Follow
Available on crate feature namespace-appbsky
only.
impl Collection for Follow
Available on crate feature
namespace-appbsky
only.source§impl Collection for List
Available on crate feature namespace-appbsky
only.
impl Collection for List
Available on crate feature
namespace-appbsky
only.source§impl Collection for Listblock
Available on crate feature namespace-appbsky
only.
impl Collection for Listblock
Available on crate feature
namespace-appbsky
only.source§impl Collection for Listitem
Available on crate feature namespace-appbsky
only.
impl Collection for Listitem
Available on crate feature
namespace-appbsky
only.source§impl Collection for Service
Available on crate feature namespace-appbsky
only.
impl Collection for Service
Available on crate feature
namespace-appbsky
only.source§impl Collection for Declaration
Available on crate feature namespace-chatbsky
only.
impl Collection for Declaration
Available on crate feature
namespace-chatbsky
only.