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
pub struct ModelA 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
pub fn entity_type(&self) -> EntityTypeWhich domain type entity_id refers to.
| Parameter | Type | Description |
|---|---|---|
| returns | EntityType |
Model::body
pub fn body(&self) -> &StringMarkdown body content.
| Parameter | Type | Description |
|---|---|---|
| returns | &String |
Model::created_at
pub fn created_at(&self) -> &DateTime<Utc>When the note was first created.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
Model::entity_id
pub fn entity_id(&self) -> &IdIdentifier of the entity the note is attached to.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::id
pub fn id(&self) -> &IdStable identifier assigned at creation.
| Parameter | Type | Description |
|---|---|---|
| returns | &Id |
Model::updated_at
pub fn updated_at(&self) -> &DateTime<Utc>When the note body was last modified.
| Parameter | Type | Description |
|---|---|---|
| returns | &DateTime<Utc> |
struct New
pub struct NewParameters 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
pub struct PatchOptional fields for updating an existing note.
| Field | Type | Description |
|---|---|---|
body |
Option<String> | Replacement markdown body. |
Implements Clone, Debug, Default, Deserialize<'de>, Serialize.