note

The notes table: notes attached to an entity, each with an optional author.

Model is one row. New and Patch carry the input of a create and an update.

struct Model

source

pub struct Model

A note attached to an entity.

Field Type Description
author_id Option<Id> Author who wrote the note, if known.
body String Markdown body content.
created_at DateTime<Utc> When the note was first created.
entity_id Id Identifier of the entity the note is attached to.
entity_type EntityType Which domain type entity_id refers to.
id Id Stable identifier assigned at creation.
updated_at DateTime<Utc> When the note body was last modified.

Implements Clone, Debug, Deserialize<'de>, Eq, PartialEq, Serialize, TryFrom<Row>, From<&Model>.

Model::entity_type

source

pub fn entity_type(&self) -> EntityType

Which domain type entity_id refers to.

Parameter Type Description
returns EntityType

Model::author_id

source

pub fn author_id(&self) -> &Option<Id>

Author who wrote the note, if known.

Parameter Type Description
returns &Option<Id>

Model::body

source

pub fn body(&self) -> &String

Markdown body content.

Parameter Type Description
returns &String

Model::created_at

source

pub fn created_at(&self) -> &DateTime<Utc>

When the note was first created.

Parameter Type Description
returns &DateTime<Utc>

Model::entity_id

source

pub fn entity_id(&self) -> &Id

Identifier of the entity the note is attached to.

Parameter Type Description
returns &Id

Model::id

source

pub fn id(&self) -> &Id

Stable identifier assigned at creation.

Parameter Type Description
returns &Id

Model::updated_at

source

pub fn updated_at(&self) -> &DateTime<Utc>

When the note body was last modified.

Parameter Type Description
returns &DateTime<Utc>

struct New

source

pub struct New

Parameters for creating a new note.

Field Type Description
author_id Option<Id> Author credited with the note, if known.
body String Markdown body content.

Implements Clone, Debug, Deserialize<'de>, Serialize.

struct Patch

source

pub struct Patch

Optional fields for updating an existing note.

Field Type Description
body Option<String> Replacement markdown body.

Implements Clone, Debug, Default, Deserialize<'de>, Serialize.