# bookclerk_library::entities::destination_objects

SeaORM entity for `destination_objects`: the last known state of every
object at each output destination (storage destinations ADR,
`docs/adr/storage-destinations.md`, decision 5).

Written by the destination sync pass from the destination's change feed
and its scheduled listing ([`crate::LibraryStore::record_seen_objects`](/docs/internals/crates/bookclerk_library/index.md#librarystorerecord_seen_objects),
[`crate::LibraryStore::remove_seen_objects`](/docs/internals/crates/bookclerk_library/index.md#librarystoreremove_seen_objects),
[`crate::LibraryStore::finish_listing`](/docs/internals/crates/bookclerk_library/index.md#librarystorefinish_listing)); read by the readers that
act on outside changes, which page the rows changed since a sequence
number ([`crate::LibraryStore::changed_objects`](/docs/internals/crates/bookclerk_library/index.md#librarystorechanged_objects)).

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for this table (`DeriveEntityModel`). |
| [`ColumnIter`](#columniter) | struct | An iterator over the variants of [Column] |
| [`Entity`](#entity) | struct | Generated by sea-orm-macros |
| [`PrimaryKeyIter`](#primarykeyiter) | struct | An iterator over the variants of [PrimaryKey] |
| [`ActiveModel`](#activemodel) | struct | Generated by sea-orm-macros |
| [`RelationIter`](#relationiter) | struct | An iterator over the variants of [Relation] |
| [`Column`](#column) | enum | Generated by sea-orm-macros |
| [`PrimaryKey`](#primarykey) | enum | Generated by sea-orm-macros |
| [`Relation`](#relation) | enum | Declared SeaORM relations (none unless FK edges are modeled). |

## Structs

### Model

```rust
pub struct Model {
    pub destination: String,
    pub object_key: String,
    pub size: i64,
    pub signature: Option<String>,
    pub modified_at_ms: Option<i64>,
    pub listed_seq: i64,
    pub changed_seq: i64,
    pub removed: i64,
    pub changed_at: String,
}
```

Row shape for this table (`DeriveEntityModel`).

**Fields**

- `destination`: The destination's plugin instance id.
- `object_key`: The object's key at the destination, as its listing names it.
- `size`: Object size in bytes when last seen.
- `signature`: The backend's opaque change signature (or entity tag) when last
  seen; `None` when the backend gave neither.
- `modified_at_ms`: Last modification time in UTC unix milliseconds, when known.
- `listed_seq`: The destination's change sequence of the last listing or feed page
  that saw the object.
- `changed_seq`: The destination's change sequence when the row last changed (added,
  modified or removed).
- `removed`: 1 once the object is gone (a tombstone kept for readers that page
  changes), else 0.
- `changed_at`: RFC 3339 time the row last changed.

#### Model::into_ex

```rust
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

```rust
pub struct ColumnIter {
    /* private fields */
}
```

An iterator over the variants of [Column](#column)

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

### Entity

```rust
pub struct Entity;
```

Generated by sea-orm-macros

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

### PrimaryKeyIter

```rust
pub struct PrimaryKeyIter {
    /* private fields */
}
```

An iterator over the variants of [PrimaryKey](#primarykey)

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

### ActiveModel

```rust
pub struct ActiveModel {
    pub destination: ActiveValue<String>,
    pub object_key: ActiveValue<String>,
    pub size: ActiveValue<i64>,
    pub signature: ActiveValue<Option<String>>,
    pub modified_at_ms: ActiveValue<Option<i64>>,
    pub listed_seq: ActiveValue<i64>,
    pub changed_seq: ActiveValue<i64>,
    pub removed: ActiveValue<i64>,
    pub changed_at: ActiveValue<String>,
}
```

Generated by sea-orm-macros

**Fields**

- `destination`: Generated by sea-orm-macros
- `object_key`: Generated by sea-orm-macros
- `size`: Generated by sea-orm-macros
- `signature`: Generated by sea-orm-macros
- `modified_at_ms`: Generated by sea-orm-macros
- `listed_seq`: Generated by sea-orm-macros
- `changed_seq`: Generated by sea-orm-macros
- `removed`: Generated by sea-orm-macros
- `changed_at`: Generated by sea-orm-macros

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

### RelationIter

```rust
pub struct RelationIter {
    /* private fields */
}
```

An iterator over the variants of [Relation](#relation)

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

## Enums

### Column

```rust
pub enum Column {
    Destination,
    ObjectKey,
    Size,
    Signature,
    ModifiedAtMs,
    ListedSeq,
    ChangedSeq,
    Removed,
    ChangedAt,
}
```

Generated by sea-orm-macros

**Variants**

- `Destination`: Generated by sea-orm-macros
- `ObjectKey`: Generated by sea-orm-macros
- `Size`: Generated by sea-orm-macros
- `Signature`: Generated by sea-orm-macros
- `ModifiedAtMs`: Generated by sea-orm-macros
- `ListedSeq`: Generated by sea-orm-macros
- `ChangedSeq`: Generated by sea-orm-macros
- `Removed`: Generated by sea-orm-macros
- `ChangedAt`: Generated by sea-orm-macros

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

### PrimaryKey

```rust
pub enum PrimaryKey {
    Destination,
    ObjectKey,
}
```

Generated by sea-orm-macros

**Variants**

- `Destination`: Generated by sea-orm-macros
- `ObjectKey`: Generated by sea-orm-macros

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

### Relation

```rust
pub enum Relation {}
```

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

Implements: `Clone`, `Copy`, `Debug`, `IntoEnumIterator`, `RelationTrait`
