pub struct Comment {
pub id: NativeId,
pub author: Option<String>,
pub created_at: Option<DateTime<Utc>>,
pub updated_at: Option<DateTime<Utc>>,
pub body: String,
pub url: Option<String>,
pub origin: Option<CommentOrigin>,
}Expand description
One comment on a task, as its source holds it.
id and body are always there; every other member is None when the source did not
give it, which is not the same as the source saying it is empty.
Fields§
§id: NativeIdThe comment’s own id, exactly as its source issued it.
Opaque, as every NativeId is, and never qualified: a comment is addressed through
the qualified id of the task it is on, so its own id needs no source of its own.
Who wrote it, in the source’s own spelling of a person.
created_at: Option<DateTime<Utc>>When the source says it was written.
updated_at: Option<DateTime<Utc>>When the source says it last changed.
body: StringWhat it says, byte for byte as it was written — a trailing newline included.
url: Option<String>Where a person can open it.
origin: Option<CommentOrigin>The comment this one is a copy of, at its origin — present only on a comment a copy wrote, and absent on every comment a person wrote where it is.
On the second hop of a chained copy it still names the first origin, never the source the copy read it from. Left out of the wire when absent, so a reader written before it existed reads exactly what it read before.
Implementations§
Source§impl Comment
impl Comment
Sourcepub fn unmarked(self) -> Self
pub fn unmarked(self) -> Self
This comment with a marker CommentOrigin::mark wrote taken out of its body and
reported as its origin; unchanged when it carries an origin already
or its body ends in no such marker.
A marker that does not parse is left in the body as text: it is not one this product wrote, and reading it as an origin would put words in a person’s comment. An origin a source reports natively — a stdio peer’s, say — is held to the same test: one naming no qualified task is dropped, so the comment reads as one written where it is, which a copy never edits or deletes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Comment
impl<'de> Deserialize<'de> for Comment
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Comment
impl JsonSchema for Comment
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more