pub struct Annotated<T>where
T: AnnotateAble,{
pub raw: T,
pub annotations: Option<Annotations>,
}
Fields§
§raw: T
§annotations: Option<Annotations>
Implementations§
Source§impl<T> Annotated<T>where
T: AnnotateAble,
impl<T> Annotated<T>where
T: AnnotateAble,
pub fn new(raw: T, annotations: Option<Annotations>) -> Annotated<T>
pub fn remove_annotation(&mut self) -> Option<Annotations>
pub fn audience(&self) -> Option<&Vec<Role>>
pub fn priority(&self) -> Option<f32>
pub fn timestamp(&self) -> Option<DateTime<Utc>>
pub fn with_audience(self, audience: Vec<Role>) -> Annotated<T>
pub fn with_priority(self, priority: f32) -> Annotated<T>
pub fn with_timestamp(self, timestamp: DateTime<Utc>) -> Annotated<T>
pub fn with_timestamp_now(self) -> Annotated<T>
Source§impl Annotated<RawContent>
impl Annotated<RawContent>
pub fn text<S>(text: S) -> Annotated<RawContent>
pub fn image<S, T>(data: S, mime_type: T) -> Annotated<RawContent>
pub fn resource(resource: ResourceContents) -> Annotated<RawContent>
pub fn embedded_text<S, T>(uri: S, content: T) -> Annotated<RawContent>
pub fn json<S>(json: S) -> Result<Annotated<RawContent>, ErrorData>where
S: Serialize,
Trait Implementations§
Source§impl<T> Deref for Annotated<T>where
T: AnnotateAble,
impl<T> Deref for Annotated<T>where
T: AnnotateAble,
Source§impl<T> DerefMut for Annotated<T>where
T: AnnotateAble,
impl<T> DerefMut for Annotated<T>where
T: AnnotateAble,
Source§impl<'de, T> Deserialize<'de> for Annotated<T>where
T: AnnotateAble + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Annotated<T>where
T: AnnotateAble + Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Annotated<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Annotated<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl IntoContents for Annotated<RawContent>
impl IntoContents for Annotated<RawContent>
fn into_contents(self) -> Vec<Annotated<RawContent>>
Source§impl<T> Serialize for Annotated<T>where
T: AnnotateAble + Serialize,
impl<T> Serialize for Annotated<T>where
T: AnnotateAble + Serialize,
Source§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,
Serialize this value into the given Serde serializer. Read more
impl<T> StructuralPartialEq for Annotated<T>where
T: AnnotateAble,
Auto Trait Implementations§
impl<T> Freeze for Annotated<T>where
T: Freeze,
impl<T> RefUnwindSafe for Annotated<T>where
T: RefUnwindSafe,
impl<T> Send for Annotated<T>where
T: Send,
impl<T> Sync for Annotated<T>where
T: Sync,
impl<T> Unpin for Annotated<T>where
T: Unpin,
impl<T> UnwindSafe for Annotated<T>where
T: UnwindSafe,
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> IntoCallToolResult for Twhere
T: IntoContents,
impl<T> IntoCallToolResult for Twhere
T: IntoContents,
fn into_call_tool_result(self) -> Result<CallToolResult, ErrorData>
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 more