Struct json_syntax::kind::KindSet
source · pub struct KindSet(/* private fields */);
Expand description
Set of JSON value Kind
.
Implementations§
source§impl KindSet
impl KindSet
pub const fn none() -> Self
pub const fn len(&self) -> usize
pub const fn is_empty(&self) -> bool
pub fn iter(&self) -> KindSetIter ⓘ
sourcepub fn as_disjunction(self) -> KindSetDisjunction
pub fn as_disjunction(self) -> KindSetDisjunction
Displays this set as a disjunction.
§Example
let set = Kind::Null | Kind::String | Kind::Object;
assert_eq!(set.as_disjunction().to_string(), "null, string or object");
assert_eq!(KindSet::ARRAY.as_disjunction().to_string(), "array");
assert_eq!(KindSet::all().as_disjunction().to_string(), "anything");
assert_eq!(KindSet::none().as_disjunction().to_string(), "nothing");
sourcepub fn as_conjunction(self) -> KindSetConjunction
pub fn as_conjunction(self) -> KindSetConjunction
Displays this set as a conjunction.
§Example
let set = Kind::Null | Kind::String | Kind::Object;
assert_eq!(set.as_conjunction().to_string(), "null, string and object");
assert_eq!(KindSet::ARRAY.as_conjunction().to_string(), "array");
assert_eq!(KindSet::all().as_conjunction().to_string(), "anything");
assert_eq!(KindSet::none().as_conjunction().to_string(), "nothing");
Trait Implementations§
source§impl BitAndAssign<Kind> for KindSet
impl BitAndAssign<Kind> for KindSet
source§fn bitand_assign(&mut self, other: Kind)
fn bitand_assign(&mut self, other: Kind)
Performs the
&=
operation. Read moresource§impl BitAndAssign for KindSet
impl BitAndAssign for KindSet
source§fn bitand_assign(&mut self, other: Self)
fn bitand_assign(&mut self, other: Self)
Performs the
&=
operation. Read moresource§impl BitOrAssign<Kind> for KindSet
impl BitOrAssign<Kind> for KindSet
source§fn bitor_assign(&mut self, other: Kind)
fn bitor_assign(&mut self, other: Kind)
Performs the
|=
operation. Read moresource§impl BitOrAssign for KindSet
impl BitOrAssign for KindSet
source§fn bitor_assign(&mut self, other: Self)
fn bitor_assign(&mut self, other: Self)
Performs the
|=
operation. Read moresource§impl<'a> IntoIterator for &'a KindSet
impl<'a> IntoIterator for &'a KindSet
source§impl IntoIterator for KindSet
impl IntoIterator for KindSet
source§impl Ord for KindSet
impl Ord for KindSet
source§impl PartialEq for KindSet
impl PartialEq for KindSet
source§impl PartialOrd for KindSet
impl PartialOrd for KindSet
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for KindSet
impl Eq for KindSet
impl StructuralPartialEq for KindSet
Auto Trait Implementations§
impl Freeze for KindSet
impl RefUnwindSafe for KindSet
impl Send for KindSet
impl Sync for KindSet
impl Unpin for KindSet
impl UnwindSafe for KindSet
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
source§impl<T> CallHasher for T
impl<T> CallHasher for T
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
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
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)