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<Item = ListWrapping> + ExactSizeIterator<Item = ListWrapping>
pub fn list_wrappings( self, ) -> impl DoubleEndedIterator<Item = ListWrapping> + ExactSizeIterator<Item = ListWrapping>
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 list(self) -> Self
pub const fn list_non_null(self) -> Self
pub const fn non_null(self) -> Self
Sourcepub fn is_equal_or_more_lenient_than(self, other: Wrapping) -> bool
pub fn is_equal_or_more_lenient_than(self, other: Wrapping) -> bool
Whether a type wrapped with Self could receive a type wrapping with other.
pub fn without_list(self) -> Option<Wrapping>
pub fn without_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<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<MutableWrapping> for Wrapping
impl From<MutableWrapping> for Wrapping
Source§fn from(wrapping: MutableWrapping) -> Self
fn from(wrapping: MutableWrapping) -> Self
Converts to this type from the input type.
Source§impl From<Wrapping> for MutableWrapping
impl From<Wrapping> for MutableWrapping
Source§impl Ord for Wrapping
impl Ord for Wrapping
Source§impl PartialOrd for Wrapping
impl PartialOrd for Wrapping
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