Struct oas_core::UntypedRecord
source · [−]pub struct UntypedRecord { /* private fields */ }
Expand description
An untyped record is a record without static typing. The value is encoded as a JSON object.
Implementations
sourceimpl UntypedRecord
impl UntypedRecord
sourcepub fn with_typ_id_value(
typ: &str,
id: &str,
value: Value
) -> Result<UntypedRecord, DecodingError>
pub fn with_typ_id_value(
typ: &str,
id: &str,
value: Value
) -> Result<UntypedRecord, DecodingError>
Create an untyped record from type and id strings and a serde_json::Value.
The value should be a serde_json::Map, otherwise this method will return an DecodingError::NotAnObject.
pub fn into_typed_record<T>(self) -> Result<TypedRecord<T>, DecodingError>where
T: 'static + TypedValue + DeserializeOwned + Clone,
sourcepub fn into_typed<T>(self) -> Result<TypedRecord<T>, DecodingError>where
T: 'static + TypedValue + DeserializeOwned + Clone,
pub fn into_typed<T>(self) -> Result<TypedRecord<T>, DecodingError>where
T: 'static + TypedValue + DeserializeOwned + Clone,
Convert this untyped record into a typed [Record]. #[deprecated(note = “use into_typed”)]
sourcepub fn into_json_object(self) -> Result<Map<String, Value>, EncodingError>
pub fn into_json_object(self) -> Result<Map<String, Value>, EncodingError>
Convert the untyped record into a JSON [Object].
pub fn meta(&self) -> &RecordMeta
pub fn meta_mut(&mut self) -> &mut RecordMeta
sourcepub fn merge_json_value(
&mut self,
value_to_merge: Value
) -> Result<(), EncodingError>
pub fn merge_json_value(
&mut self,
value_to_merge: Value
) -> Result<(), EncodingError>
Merge this record’s value with another JSON value.
pub fn apply_json_patch(&mut self, patch: &Patch) -> Result<(), EncodingError>
Trait Implementations
sourceimpl Clone for UntypedRecord
impl Clone for UntypedRecord
sourcefn clone(&self) -> UntypedRecord
fn clone(&self) -> UntypedRecord
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for UntypedRecord
impl Debug for UntypedRecord
sourceimpl<'de> Deserialize<'de> for UntypedRecord
impl<'de> Deserialize<'de> for UntypedRecord
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<UntypedRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<UntypedRecord, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl JsonSchema for UntypedRecord
impl JsonSchema for UntypedRecord
sourcefn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
sourcefn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moresourceimpl Serialize for UntypedRecord
impl Serialize for UntypedRecord
sourcefn 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
sourceimpl<T> TryFrom<TypedRecord<T>> for UntypedRecordwhere
T: TypedValue,
impl<T> TryFrom<TypedRecord<T>> for UntypedRecordwhere
T: TypedValue,
type Error = EncodingError
type Error = EncodingError
The type returned in the event of a conversion error.
sourcefn try_from(
record: TypedRecord<T>
) -> Result<UntypedRecord, <UntypedRecord as TryFrom<TypedRecord<T>>>::Error>
fn try_from(
record: TypedRecord<T>
) -> Result<UntypedRecord, <UntypedRecord as TryFrom<TypedRecord<T>>>::Error>
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for UntypedRecord
impl Send for UntypedRecord
impl Sync for UntypedRecord
impl Unpin for UntypedRecord
impl UnwindSafe for UntypedRecord
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
Converts
self
into a collection.fn mapped<U, F, A>(self, f: F) -> SmallVec<A>where
F: FnMut(T) -> U,
A: Array<Item = U>,
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be
Self