pub struct Extension {
pub ty: ExtensionTypeId,
pub description: String,
pub extension: Value,
}
Expand description
Extension on a type. The extension allows to extend information
Fields§
§ty: ExtensionTypeId
The type definition contains the namespace and the type name.
description: String
Textual description of the extension.
extension: Value
The extension as JSON representation.
Implementations§
Source§impl Extension
impl Extension
Sourcepub fn new<T: Into<ExtensionTypeId>, S: Into<String>>(
ty: T,
description: S,
extension: Value,
) -> Extension
pub fn new<T: Into<ExtensionTypeId>, S: Into<String>>( ty: T, description: S, extension: Value, ) -> Extension
Constructs an extension from the given namespaced type with the given description, components, properties and extensions.
pub fn new_from_type<S: Into<String>>( namespace: S, type_name: S, description: S, extension: Value, ) -> Extension
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Extension
impl<'de> Deserialize<'de> for Extension
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
Source§impl From<&Extension> for TypeDefinition
impl From<&Extension> for TypeDefinition
Source§impl FromIterator<Extension> for Extensions
impl FromIterator<Extension> for Extensions
Source§impl JsonSchema for Extension
impl JsonSchema for Extension
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 more§fn always_inline_schema() -> bool
fn always_inline_schema() -> bool
👎Deprecated: Use
inline_schema()
insteadOnly included for backward-compatibility - use
inline_schema()
instead“. Read moreSource§impl NamespacedTypeGetter for Extension
impl NamespacedTypeGetter for Extension
Source§impl Ord for Extension
impl Ord for Extension
Source§impl PartialEq<ExtensionTypeId> for Extension
impl PartialEq<ExtensionTypeId> for Extension
Source§impl PartialOrd for Extension
impl PartialOrd for Extension
Source§impl TypeDefinitionGetter for Extension
impl TypeDefinitionGetter for Extension
Source§fn type_definition(&self) -> TypeDefinition
fn type_definition(&self) -> TypeDefinition
Returns the type definition of the type.
impl Eq for Extension
impl StructuralPartialEq for Extension
Auto Trait Implementations§
impl Freeze for Extension
impl RefUnwindSafe for Extension
impl Send for Extension
impl Sync for Extension
impl Unpin for Extension
impl UnwindSafe for Extension
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,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
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 moreSource§impl<T> JsonSchemaIdGetter for Twhere
T: TypeDefinitionGetter,
impl<T> JsonSchemaIdGetter for Twhere
T: TypeDefinitionGetter,
Source§fn json_schema_id(&self) -> JsonSchemaId
fn json_schema_id(&self) -> JsonSchemaId
Returns the JSON Schema identifier ($id).