# bookclerk_library::entities::metadata_claims

SeaORM entity for `metadata_claims`: one source's value for one field
of one subject (`docs/adr/metadata-claims-and-file-sync.md`). Chapters
of an edition are the only field so far (`store::chapters`).

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for one claim. |
| [`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). |

## Structs

### Model

```rust
pub struct Model {
    pub subject_kind: String,
    pub subject_id: String,
    pub field: String,
    pub source_kind: String,
    pub source_id: String,
    pub locale: String,
    pub quality: String,
    pub value_digest: String,
    pub runtime_ms: Option<i64>,
    pub input_digest: Option<String>,
    pub revision: i64,
    pub pinned_at: Option<String>,
    pub pinned_by_user_id: Option<i64>,
    pub created_by_user_id: Option<i64>,
    pub updated_at: String,
}
```

Row shape for one claim.

**Fields**

- `subject_kind`: What the claim is about: `edition`.
- `subject_id`: The subject's id (`editions.id`).
- `field`: The field: `chapters`.
- `source_kind`: The kind of source ([`crate::ChapterSourceKind`](/docs/internals/crates/bookclerk_library/index.md#chaptersourcekind) spelling).
- `source_id`: Which source of that kind: a plugin key for a provider or a store,
  empty for a person's edit and for Bookclerk's own processing.
- `locale`: BCP 47 language of the value; empty when unknown or not applicable.
- `quality`: Where a machine source ranks ([`crate::ClaimQuality`](/docs/internals/crates/bookclerk_library/index.md#claimquality) spelling);
  empty for people and for Bookclerk's own processing.
- `value_digest`: Digest of the value (a `chapter_lists` row for chapters).
- `runtime_ms`: Length of the timeline the value was measured on, in milliseconds.
- `input_digest`: For a processed claim, the digest of the value it was derived from.
- `revision`: The subject's claim counter when this claim last changed.
- `pinned_at`: RFC 3339 time an Administrator pinned the claim; `None` when not
  pinned.
- `pinned_by_user_id`: The Administrator who pinned it.
- `created_by_user_id`: The person whose edit the claim is, for a person's edit.
- `updated_at`: RFC 3339 time the claim 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 subject_kind: ActiveValue<String>,
    pub subject_id: ActiveValue<String>,
    pub field: ActiveValue<String>,
    pub source_kind: ActiveValue<String>,
    pub source_id: ActiveValue<String>,
    pub locale: ActiveValue<String>,
    pub quality: ActiveValue<String>,
    pub value_digest: ActiveValue<String>,
    pub runtime_ms: ActiveValue<Option<i64>>,
    pub input_digest: ActiveValue<Option<String>>,
    pub revision: ActiveValue<i64>,
    pub pinned_at: ActiveValue<Option<String>>,
    pub pinned_by_user_id: ActiveValue<Option<i64>>,
    pub created_by_user_id: ActiveValue<Option<i64>>,
    pub updated_at: ActiveValue<String>,
}
```

Generated by sea-orm-macros

**Fields**

- `subject_kind`: Generated by sea-orm-macros
- `subject_id`: Generated by sea-orm-macros
- `field`: Generated by sea-orm-macros
- `source_kind`: Generated by sea-orm-macros
- `source_id`: Generated by sea-orm-macros
- `locale`: Generated by sea-orm-macros
- `quality`: Generated by sea-orm-macros
- `value_digest`: Generated by sea-orm-macros
- `runtime_ms`: Generated by sea-orm-macros
- `input_digest`: Generated by sea-orm-macros
- `revision`: Generated by sea-orm-macros
- `pinned_at`: Generated by sea-orm-macros
- `pinned_by_user_id`: Generated by sea-orm-macros
- `created_by_user_id`: 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

```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 {
    SubjectKind,
    SubjectId,
    Field,
    SourceKind,
    SourceId,
    Locale,
    Quality,
    ValueDigest,
    RuntimeMs,
    InputDigest,
    Revision,
    PinnedAt,
    PinnedByUserId,
    CreatedByUserId,
    UpdatedAt,
}
```

Generated by sea-orm-macros

**Variants**

- `SubjectKind`: Generated by sea-orm-macros
- `SubjectId`: Generated by sea-orm-macros
- `Field`: Generated by sea-orm-macros
- `SourceKind`: Generated by sea-orm-macros
- `SourceId`: Generated by sea-orm-macros
- `Locale`: Generated by sea-orm-macros
- `Quality`: Generated by sea-orm-macros
- `ValueDigest`: Generated by sea-orm-macros
- `RuntimeMs`: Generated by sea-orm-macros
- `InputDigest`: Generated by sea-orm-macros
- `Revision`: Generated by sea-orm-macros
- `PinnedAt`: Generated by sea-orm-macros
- `PinnedByUserId`: Generated by sea-orm-macros
- `CreatedByUserId`: Generated by sea-orm-macros
- `UpdatedAt`: Generated by sea-orm-macros

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

### PrimaryKey

```rust
pub enum PrimaryKey {
    SubjectKind,
    SubjectId,
    Field,
    SourceKind,
    SourceId,
    Locale,
}
```

Generated by sea-orm-macros

**Variants**

- `SubjectKind`: Generated by sea-orm-macros
- `SubjectId`: Generated by sea-orm-macros
- `Field`: Generated by sea-orm-macros
- `SourceKind`: Generated by sea-orm-macros
- `SourceId`: Generated by sea-orm-macros
- `Locale`: Generated by sea-orm-macros

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

### Relation

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

Declared SeaORM relations (none).

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