pub struct SsbMessageValue {
    pub previous: Option<String>,
    pub author: String,
    pub sequence: u64,
    pub timestamp: f64,
    pub hash: String,
    pub content: Value,
    pub signature: String,
}
Expand description

The value of an SSB message (the V in KVT).

More information concerning the data model can be found in the Metadata documentation.

Fields

previous: Option<String>author: Stringsequence: u64timestamp: f64hash: Stringcontent: Valuesignature: String

Implementations

Get the type field of the message content as an enum, if found.

If no type field is found or the type field is not a string, it returns an Err(GolgiError::ContentType).

If a type field is found but with an unknown string, it returns an Ok(SsbMessageContentType::Unrecognized).

Helper function which returns true if this message is of the given type, and false if the type does not match or is not found.

Convert the content JSON value into an SsbMessageContent enum, using the type field as a tag to select which variant of the enum to deserialize into.

See the Serde docs on internally-tagged enum representations for further details.

Trait Implementations

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.