pub struct ModelModalities(/* private fields */);Expand description
Sorted, duplicate-free model modality set.
The JSON wire form is an array. Serialization always uses enum order; construction and deserialization reject duplicates and resource excess.
Implementations§
Source§impl ModelModalities
impl ModelModalities
Sourcepub fn try_new<I>(modalities: I) -> Result<Self, ModelModalitiesError>where
I: IntoIterator<Item = ModelModality>,
pub fn try_new<I>(modalities: I) -> Result<Self, ModelModalitiesError>where
I: IntoIterator<Item = ModelModality>,
Constructs a sorted, duplicate-free modality set.
§Errors
Returns ModelModalitiesError when a modality is repeated or the
hard collection ceiling is exceeded.
Sourcepub fn contains(&self, modality: ModelModality) -> bool
pub fn contains(&self, modality: ModelModality) -> bool
Returns whether the exact modality is present.
Sourcepub fn iter(&self) -> Iter<'_, ModelModality> ⓘ
pub fn iter(&self) -> Iter<'_, ModelModality> ⓘ
Iterates in stable enum order.
Trait Implementations§
Source§impl Clone for ModelModalities
impl Clone for ModelModalities
Source§impl Debug for ModelModalities
impl Debug for ModelModalities
Source§impl Default for ModelModalities
impl Default for ModelModalities
Source§impl<'de> Deserialize<'de> for ModelModalities
impl<'de> Deserialize<'de> for ModelModalities
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ModelModalities
Source§impl<'a> IntoIterator for &'a ModelModalities
impl<'a> IntoIterator for &'a ModelModalities
Source§impl JsonSchema for ModelModalities
impl JsonSchema for ModelModalities
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ModelModalities
impl PartialEq for ModelModalities
Source§impl Serialize for ModelModalities
impl Serialize for ModelModalities
impl StructuralPartialEq for ModelModalities
Source§impl TryFrom<Vec<ModelModality>> for ModelModalities
impl TryFrom<Vec<ModelModality>> for ModelModalities
Auto Trait Implementations§
impl Forget for ModelModalities
impl Freeze for ModelModalities
impl Move for ModelModalities
impl RefUnwindSafe for ModelModalities
impl Send for ModelModalities
impl Sync for ModelModalities
impl Unpin for ModelModalities
impl UnsafeUnpin for ModelModalities
impl UnwindSafe for ModelModalities
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