pub struct ResponseFormat<V> {
pub inner: Either<V, JsonBytes>,
}
Expand description
This is a wrapper for JSON serialization to select the format between Json and Hex.
§Examples
ResponseFormat<BlockView>
returns the block in its Json format or molecule serialized
Hex format.
Fields§
§inner: Either<V, JsonBytes>
The inner value.
Implementations§
Trait Implementations§
Source§impl<V: Clone> Clone for ResponseFormat<V>
impl<V: Clone> Clone for ResponseFormat<V>
Source§fn clone(&self) -> ResponseFormat<V>
fn clone(&self) -> ResponseFormat<V>
Returns a copy 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<V: Debug> Debug for ResponseFormat<V>
impl<V: Debug> Debug for ResponseFormat<V>
Source§impl<'de, V> Deserialize<'de> for ResponseFormat<V>where
V: Deserialize<'de>,
impl<'de, V> Deserialize<'de> for ResponseFormat<V>where
V: Deserialize<'de>,
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<V: Hash> Hash for ResponseFormat<V>
impl<V: Hash> Hash for ResponseFormat<V>
Source§impl<V: JsonSchema> JsonSchema for ResponseFormat<V>
impl<V: JsonSchema> JsonSchema for ResponseFormat<V>
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
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(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§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 moreSource§impl<V: PartialEq> PartialEq for ResponseFormat<V>
impl<V: PartialEq> PartialEq for ResponseFormat<V>
Source§impl<V> Serialize for ResponseFormat<V>where
V: Serialize,
impl<V> Serialize for ResponseFormat<V>where
V: Serialize,
impl<V: Eq> Eq for ResponseFormat<V>
impl<V> StructuralPartialEq for ResponseFormat<V>
Auto Trait Implementations§
impl<V> !Freeze for ResponseFormat<V>
impl<V> RefUnwindSafe for ResponseFormat<V>where
V: RefUnwindSafe,
impl<V> Send for ResponseFormat<V>where
V: Send,
impl<V> Sync for ResponseFormat<V>where
V: Sync,
impl<V> Unpin for ResponseFormat<V>where
V: Unpin,
impl<V> UnwindSafe for ResponseFormat<V>where
V: 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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)