Struct MessageMetadata
pub struct MessageMetadata {
pub is_writing: bool,
pub created_at: DateTime<Utc>,
pub reasoning_updated_at: DateTime<Utc>,
pub text_updated_at: DateTime<Utc>,
}Expand description
Metadata automatically tracked by MolyKit for each message.
“Metadata” basically means “data about data”. Like tracking timestamps for data modification.
Fields§
§is_writing: boolRuntime flag indicating that the message is still incomplete (being written).
Skipped during serialization.
created_at: DateTime<Utc>When the message got created.
Default to epoch if missing during deserialization. Otherwise, if constructed
by MessageMetadata::default, it defaults to “now”.
reasoning_updated_at: DateTime<Utc>Last time the reasoning/thinking content was updated.
Default to epoch if missing during deserialization. Otherwise, if constructed
by MessageMetadata::default, it defaults to “now”.
text_updated_at: DateTime<Utc>Last time the main text was updated.
Default to epoch if missing during deserialization. Otherwise, if constructed
by MessageMetadata::default, it defaults to “now”.
Implementations§
§impl MessageMetadata
impl MessageMetadata
pub fn new() -> MessageMetadata
pub fn new() -> MessageMetadata
Same behavior as MessageMetadata::default.
pub fn epoch() -> MessageMetadata
pub fn epoch() -> MessageMetadata
Create a new metadata with all fields set to default but timestamps set to epoch.
§impl MessageMetadata
impl MessageMetadata
pub fn reasoning_time_taken_seconds(&self) -> f32
pub fn reasoning_time_taken_seconds(&self) -> f32
The inferred amount of time the reasoning step took, in seconds (with milliseconds).
pub fn is_idle(&self) -> bool
pub fn is_writing(&self) -> bool
Trait Implementations§
§impl Clone for MessageMetadata
impl Clone for MessageMetadata
§fn clone(&self) -> MessageMetadata
fn clone(&self) -> MessageMetadata
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for MessageMetadata
impl Debug for MessageMetadata
§impl Default for MessageMetadata
impl Default for MessageMetadata
§fn default() -> MessageMetadata
fn default() -> MessageMetadata
§impl<'de> Deserialize<'de> for MessageMetadata
impl<'de> Deserialize<'de> for MessageMetadata
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<MessageMetadata, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for MessageMetadata
impl PartialEq for MessageMetadata
§impl Serialize for MessageMetadata
impl Serialize for MessageMetadata
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for MessageMetadata
Auto Trait Implementations§
impl Freeze for MessageMetadata
impl RefUnwindSafe for MessageMetadata
impl Send for MessageMetadata
impl Sync for MessageMetadata
impl Unpin for MessageMetadata
impl UnwindSafe for MessageMetadata
Blanket Implementations§
§impl<T> ActionTrait for T
impl<T> ActionTrait for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.