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 Constants§
Required Associated Types§
Sourcetype Record: Debug + DeserializeOwned + Serialize
type Record: Debug + DeserializeOwned + Serialize
This collection’s record type.
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
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so 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 Postgate
Available on crate feature namespace-appbsky
only.
impl Collection for Postgate
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 Starterpack
Available on crate feature namespace-appbsky
only.
impl Collection for Starterpack
Available on crate feature
namespace-appbsky
only.Source§impl Collection for Verification
Available on crate feature namespace-appbsky
only.
impl Collection for Verification
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.