pub struct MessageMeta {
pub msg_type: MessageType,
pub step_index: Option<i64>,
pub original_type: Option<MessageType>,
pub token_estimate: Option<i64>,
}Expand description
Immutable metadata attached to a message.
Fields§
§msg_type: MessageTypeThe classified message type.
step_index: Option<i64>The iteration or step index of the workflow loop.
original_type: Option<MessageType>The original message type if this message was transformed.
token_estimate: Option<i64>Estimated token count for this message.
Implementations§
Source§impl MessageMeta
impl MessageMeta
Sourcepub fn new(msg_type: MessageType) -> Self
pub fn new(msg_type: MessageType) -> Self
Creates a new MessageMeta with the given type.
Sourcepub fn with_step_index(self, idx: i64) -> Self
pub fn with_step_index(self, idx: i64) -> Self
Sets the step index.
Sourcepub fn with_original_type(self, t: MessageType) -> Self
pub fn with_original_type(self, t: MessageType) -> Self
Sets the original message type.
Sourcepub fn with_token_estimate(self, est: i64) -> Self
pub fn with_token_estimate(self, est: i64) -> Self
Sets the token estimate.
Trait Implementations§
Source§impl Clone for MessageMeta
impl Clone for MessageMeta
Source§fn clone(&self) -> MessageMeta
fn clone(&self) -> MessageMeta
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageMeta
impl Debug for MessageMeta
Source§impl PartialEq for MessageMeta
impl PartialEq for MessageMeta
Source§fn eq(&self, other: &MessageMeta) -> bool
fn eq(&self, other: &MessageMeta) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MessageMeta
Auto Trait Implementations§
impl Freeze for MessageMeta
impl RefUnwindSafe for MessageMeta
impl Send for MessageMeta
impl Sync for MessageMeta
impl Unpin for MessageMeta
impl UnsafeUnpin for MessageMeta
impl UnwindSafe for MessageMeta
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.