bookclerk_library::entities::copy_grants

Development These docs follow the development version and change with every merge.

Last updated View as Markdown

SeaORM entity for copy_grants: one reader's leave to download the copy this library holds of one edition. Written by control_plane::copies.

Item Kind Summary
Model struct Row shape for one grant.
ColumnIter struct An iterator over the variants of [Column]
Entity struct Generated by sea-orm-macros
PrimaryKeyIter struct An iterator over the variants of [PrimaryKey]
ActiveModel struct Generated by sea-orm-macros
RelationIter struct An iterator over the variants of [Relation]
Column enum Generated by sea-orm-macros
PrimaryKey enum Generated by sea-orm-macros
Relation enum Declared SeaORM relations (none).

Structs

Model

pub struct Model {
    pub copy_id: String,
    pub token_hash: String,
    pub holder_kind: String,
    pub holder_id: String,
    pub user_id: i64,
    pub edition_id: String,
    pub serving_node_id: String,
    pub destination: String,
    pub files_digest: String,
    pub created_at: String,
    pub expires_at: String,
}

Row shape for one grant.

Fields

  • copy_id: Copy id (hyphenated UUID).
  • token_hash: hash_token of the bearer token; the token itself is never stored.
  • holder_kind: What asked: node (a branch) or card (a clerk's library card).
  • holder_id: The asking node's id, or the card's id.
  • user_id: The person the copy is for (users.id).
  • edition_id: The edition copied.
  • serving_node_id: The node that answered the grant and serves the files.
  • destination: The output destination on that node the files are read from.
  • files_digest: Digest of the edition's file rows on that destination at grant, in download order; a download is refused once they differ.
  • created_at: RFC 3339 grant time.
  • expires_at: RFC 3339 time after which the token is refused.

Model::into_ex

pub fn into_ex(self) -> Self

Generated by sea-orm-macros

Implements: Clone, Debug, Eq, From<Model>, FromQueryResult, IntoActiveModel<ActiveModel>, ModelTrait, PartialEq, TryFrom<ActiveModel>, TryIntoModel<Model>

ColumnIter

pub struct ColumnIter {
    /* private fields */
}

An iterator over the variants of Column

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

Entity

pub struct Entity;

Generated by sea-orm-macros

Implements: Clone, Copy, Debug, Default, EntityName, EntityTrait, Iden, IdenStatic

PrimaryKeyIter

pub struct PrimaryKeyIter {
    /* private fields */
}

An iterator over the variants of PrimaryKey

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

ActiveModel

pub struct ActiveModel {
    pub copy_id: ActiveValue<String>,
    pub token_hash: ActiveValue<String>,
    pub holder_kind: ActiveValue<String>,
    pub holder_id: ActiveValue<String>,
    pub user_id: ActiveValue<i64>,
    pub edition_id: ActiveValue<String>,
    pub serving_node_id: ActiveValue<String>,
    pub destination: ActiveValue<String>,
    pub files_digest: ActiveValue<String>,
    pub created_at: ActiveValue<String>,
    pub expires_at: ActiveValue<String>,
}

Generated by sea-orm-macros

Fields

  • copy_id: Generated by sea-orm-macros
  • token_hash: Generated by sea-orm-macros
  • holder_kind: Generated by sea-orm-macros
  • holder_id: Generated by sea-orm-macros
  • user_id: Generated by sea-orm-macros
  • edition_id: Generated by sea-orm-macros
  • serving_node_id: Generated by sea-orm-macros
  • destination: Generated by sea-orm-macros
  • files_digest: Generated by sea-orm-macros
  • created_at: Generated by sea-orm-macros
  • expires_at: Generated by sea-orm-macros

Implements: ActiveModelBehavior, ActiveModelTrait, Clone, Debug, Default, From<Model>, IntoActiveModel<ActiveModel>, PartialEq, TryFrom<ActiveModel>, TryIntoModel<Model>

RelationIter

pub struct RelationIter {
    /* private fields */
}

An iterator over the variants of Relation

Implements: Clone, Debug, DoubleEndedIterator, ExactSizeIterator, FusedIterator, Iterator

Enums

Column

pub enum Column {
    CopyId,
    TokenHash,
    HolderKind,
    HolderId,
    UserId,
    EditionId,
    ServingNodeId,
    Destination,
    FilesDigest,
    CreatedAt,
    ExpiresAt,
}

Generated by sea-orm-macros

Variants

  • CopyId: Generated by sea-orm-macros
  • TokenHash: Generated by sea-orm-macros
  • HolderKind: Generated by sea-orm-macros
  • HolderId: Generated by sea-orm-macros
  • UserId: Generated by sea-orm-macros
  • EditionId: Generated by sea-orm-macros
  • ServingNodeId: Generated by sea-orm-macros
  • Destination: Generated by sea-orm-macros
  • FilesDigest: Generated by sea-orm-macros
  • CreatedAt: Generated by sea-orm-macros
  • ExpiresAt: Generated by sea-orm-macros

Implements: Clone, ColumnTrait, Copy, Debug, FromStr, Iden, IdenStatic, IntoEnumIterator

PrimaryKey

pub enum PrimaryKey {
    CopyId,
}

Generated by sea-orm-macros

Variants

  • CopyId: Generated by sea-orm-macros

Implements: Clone, Copy, Debug, Iden, IdenStatic, IntoEnumIterator, PrimaryKeyToColumn, PrimaryKeyTrait

Relation

pub enum Relation {}

Declared SeaORM relations (none).

Implements: Clone, Copy, Debug, IntoEnumIterator, RelationTrait

Generated from crates/bookclerk-library at main · View as Markdown