pub struct Hex<T>(pub T);
Expand description
Represent inner type as hex in JSON.
Hex<Vec<u8>>
, Hex<&[u8]>
, and Hex<[u8; SIZE]>
store binary
data. This wrapper does not support other inner types.
Tuple Fields§
§0: T
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Hex<T>where
T: FromHex,
impl<'de, T> Deserialize<'de> for Hex<T>where
T: FromHex,
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T> InputType for Hex<T>
impl<T> InputType for Hex<T>
Source§type RawValueType = Hex<T>
type RawValueType = Hex<T>
The raw type used for validator. Read more
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value
. None represents undefined.Source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl<T: Ord> Ord for Hex<T>
impl<T: Ord> Ord for Hex<T>
Source§impl<T> OutputType for Hex<T>
impl<T> OutputType for Hex<T>
Source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
Source§async fn resolve(
&self,
_: &ContextSelectionSet<'_>,
_field: &Positioned<Field>,
) -> ServerResult<Value>
async fn resolve( &self, _: &ContextSelectionSet<'_>, _field: &Positioned<Field>, ) -> ServerResult<Value>
Resolve an output value to
async_graphql::Value
.Source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
Source§impl<T: PartialOrd> PartialOrd for Hex<T>
impl<T: PartialOrd> PartialOrd for Hex<T>
Source§impl<T> ScalarType for Hex<T>
impl<T> ScalarType for Hex<T>
Source§impl<T: ToSchema + 'static> ToSchema for Hex<T>
impl<T: ToSchema + 'static> ToSchema for Hex<T>
fn schema(builder: &mut SchemaBuilder) -> AnyType
Source§impl<'a, T> Unpack<'a> for Hex<T>where
T: ToHex + Unpack<'a>,
impl<'a, T> Unpack<'a> for Hex<T>where
T: ToHex + Unpack<'a>,
Source§fn unpack(src: &'a [u8], pos: &mut u32) -> Result<Self>
fn unpack(src: &'a [u8], pos: &mut u32) -> Result<Self>
Convert from fracpack format. Also verifies the integrity of the data. Read more
Source§fn verify(src: &'a [u8], pos: &mut u32) -> Result<()>
fn verify(src: &'a [u8], pos: &mut u32) -> Result<()>
Verify the integrity of fracpack data. You don’t need to call this if
using [Pack::unpack] since it verifies integrity during unpack.
impl<T: Eq> Eq for Hex<T>
impl<T> StructuralPartialEq for Hex<T>
Auto Trait Implementations§
impl<T> Freeze for Hex<T>where
T: Freeze,
impl<T> RefUnwindSafe for Hex<T>where
T: RefUnwindSafe,
impl<T> Send for Hex<T>where
T: Send,
impl<T> Sync for Hex<T>where
T: Sync,
impl<T> Unpin for Hex<T>where
T: Unpin,
impl<T> UnwindSafe for Hex<T>where
T: 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§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.