#[non_exhaustive]pub enum SamplingContentOrArray {
Single(SamplingContent),
Array(Vec<SamplingContent>),
}Expand description
Content that can be either a single item or an array
The MCP spec allows content fields to be either a single SamplingContent or an array of SamplingContent items.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Implementations§
Source§impl SamplingContentOrArray
impl SamplingContentOrArray
Sourcepub fn items(&self) -> Vec<&SamplingContent>
pub fn items(&self) -> Vec<&SamplingContent>
Get content items as a slice
Sourcepub fn into_items(self) -> Vec<SamplingContent>
pub fn into_items(self) -> Vec<SamplingContent>
Get owned content items
Trait Implementations§
Source§impl Clone for SamplingContentOrArray
impl Clone for SamplingContentOrArray
Source§fn clone(&self) -> SamplingContentOrArray
fn clone(&self) -> SamplingContentOrArray
Returns a duplicate of the value. Read more
1.0.0 · 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 SamplingContentOrArray
impl Debug for SamplingContentOrArray
Source§impl<'de> Deserialize<'de> for SamplingContentOrArray
impl<'de> Deserialize<'de> for SamplingContentOrArray
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SamplingContentOrArray, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SamplingContentOrArray, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for SamplingContentOrArray
impl Serialize for SamplingContentOrArray
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
Auto Trait Implementations§
impl Freeze for SamplingContentOrArray
impl RefUnwindSafe for SamplingContentOrArray
impl Send for SamplingContentOrArray
impl Sync for SamplingContentOrArray
impl Unpin for SamplingContentOrArray
impl UnsafeUnpin for SamplingContentOrArray
impl UnwindSafe for SamplingContentOrArray
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