Trait 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 Constants§

Source

const NSID: &'static str

The NSID for the Lexicon that defines the schema of records in this collection.

Required Associated Types§

Source

type Record: Debug + DeserializeOwned + Serialize

This collection’s record type.

Provided Methods§

Source

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.

Source

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, normalized Nsid, followed by a /, followed by a valid RecordKey.

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.
Source§

const NSID: &'static str = "app.bsky.actor.profile"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Generator

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.generator"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Like

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.like"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Post

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.post"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Postgate

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.postgate"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Repost

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.repost"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Threadgate

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.feed.threadgate"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Block

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.block"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Follow

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.follow"

Source§

type Record = Object<RecordData>

Source§

impl Collection for List

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.list"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Listblock

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.listblock"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Listitem

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.listitem"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Starterpack

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.starterpack"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Verification

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.graph.verification"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Service

Available on crate feature namespace-appbsky only.
Source§

const NSID: &'static str = "app.bsky.labeler.service"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Declaration

Available on crate feature namespace-chatbsky only.
Source§

const NSID: &'static str = "chat.bsky.actor.declaration"

Source§

type Record = Object<RecordData>

Source§

impl Collection for Schema

Source§

const NSID: &'static str = "com.atproto.lexicon.schema"

Source§

type Record = Object<RecordData>