bookclerk_library::entities::edition_copies

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

Last updated View as Markdown

SeaORM entity for edition_copies: each edition's copy at each output destination and where it stands (storage destinations ADR, docs/adr/storage-destinations.md, decision 3).

Written by the acquire pipeline once each destination's write ends (crate::LibraryStore::set_copy_stored, crate::LibraryStore::set_copy_pending) and by a host upload's commit on the owner; read by acquire candidate selection, which visits an acquired edition again while a destination that takes it lacks a stored copy.

Item Kind Summary
Model struct Row shape for this table (DeriveEntityModel).
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 unless FK edges are modeled).

Structs

Model

pub struct Model {
    pub edition_id: String,
    pub destination: String,
    pub state: String,
    pub storage_key: Option<String>,
    pub attempts: i64,
    pub next_attempt_at: Option<String>,
    pub last_error: Option<String>,
    pub updated_at: String,
}

Row shape for this table (DeriveEntityModel).

Fields

  • edition_id: The edition (editions.id).
  • destination: The destination's plugin instance id.
  • state: Where the copy stands (CopyState::as_str): stored, pending, missing or failed.
  • storage_key: The edition's primary audio key on this destination; set once stored, and kept from an earlier stored copy while a later write is retried.
  • attempts: Failed writes since the copy was last stored (0 once stored).
  • next_attempt_at: RFC 3339 time the next background attempt is due; None unless pending.
  • last_error: The last write failure, for operators; None once stored.
  • updated_at: RFC 3339 timestamp when the row was last modified.

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 edition_id: ActiveValue<String>,
    pub destination: ActiveValue<String>,
    pub state: ActiveValue<String>,
    pub storage_key: ActiveValue<Option<String>>,
    pub attempts: ActiveValue<i64>,
    pub next_attempt_at: ActiveValue<Option<String>>,
    pub last_error: ActiveValue<Option<String>>,
    pub updated_at: ActiveValue<String>,
}

Generated by sea-orm-macros

Fields

  • edition_id: Generated by sea-orm-macros
  • destination: Generated by sea-orm-macros
  • state: Generated by sea-orm-macros
  • storage_key: Generated by sea-orm-macros
  • attempts: Generated by sea-orm-macros
  • next_attempt_at: Generated by sea-orm-macros
  • last_error: Generated by sea-orm-macros
  • updated_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 {
    EditionId,
    Destination,
    State,
    StorageKey,
    Attempts,
    NextAttemptAt,
    LastError,
    UpdatedAt,
}

Generated by sea-orm-macros

Variants

  • EditionId: Generated by sea-orm-macros
  • Destination: Generated by sea-orm-macros
  • State: Generated by sea-orm-macros
  • StorageKey: Generated by sea-orm-macros
  • Attempts: Generated by sea-orm-macros
  • NextAttemptAt: Generated by sea-orm-macros
  • LastError: Generated by sea-orm-macros
  • UpdatedAt: Generated by sea-orm-macros

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

PrimaryKey

pub enum PrimaryKey {
    EditionId,
    Destination,
}

Generated by sea-orm-macros

Variants

  • EditionId: Generated by sea-orm-macros
  • Destination: Generated by sea-orm-macros

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

Relation

pub enum Relation {}

Declared SeaORM relations (none unless FK edges are modeled).

Implements: Clone, Copy, Debug, IntoEnumIterator, RelationTrait

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