pub struct Wrapping(/* private fields */);
Expand description
It’s structured as follows:
list wrapper length (4 bits)
↓ ↓ list_wrapping (1 == Required / 0 == Nullable)
┌───┐┌───────────┐
0000_0000_0000_0000
↑
inner_is_required flag (1 == required)
The list_wrapping is stored from innermost to outermost and use the start and end as the positions within the list_wrapping bits. Acting like a simplified fixed capacity VecDeque. For simplicity of bit shifts the list wrapping is stored from right to left.
Implementations§
Source§impl Wrapping
impl Wrapping
Sourcepub fn inner_is_required(self) -> bool
pub fn inner_is_required(self) -> bool
Is the innermost type required?
Examples:
String
=> falseString!
=> true[String!]
=> true[String]!
=> false
Sourcepub fn list_wrappings(self) -> impl DoubleEndedIterator + ExactSizeIterator
pub fn list_wrappings(self) -> impl DoubleEndedIterator + ExactSizeIterator
Innermost to outermost.
Sourcepub fn iter(self) -> impl Iterator<Item = WrappingType>
pub fn iter(self) -> impl Iterator<Item = WrappingType>
From innermost to outermost.
pub fn to_mutable(self) -> MutableWrapping
pub const fn nullable() -> Wrapping
pub const fn required() -> Wrapping
pub const fn list(self) -> Wrapping
pub const fn list_non_null(self) -> Wrapping
pub const fn non_null(self) -> Wrapping
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Wrapping
impl<'de> Deserialize<'de> for Wrapping
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Wrapping, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Wrapping, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<MutableWrapping> for Wrapping
impl From<MutableWrapping> for Wrapping
Source§fn from(wrapping: MutableWrapping) -> Wrapping
fn from(wrapping: MutableWrapping) -> Wrapping
Converts to this type from the input type.
Source§impl Ord for Wrapping
impl Ord for Wrapping
Source§impl PartialOrd for Wrapping
impl PartialOrd for Wrapping
Source§impl Serialize for Wrapping
impl Serialize for Wrapping
Source§fn 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
impl Copy for Wrapping
impl Eq for Wrapping
impl StructuralPartialEq for Wrapping
Auto Trait Implementations§
impl Freeze for Wrapping
impl RefUnwindSafe for Wrapping
impl Send for Wrapping
impl Sync for Wrapping
impl Unpin for Wrapping
impl UnwindSafe for Wrapping
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.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 more