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§

source

type Record: Debug + DeserializeOwned + Serialize

This collection’s record type.

Required Associated Constants§

source

const NSID: &'static str

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

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.

Object Safety§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

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"

§

type Record = Object<RecordData>