pub struct JsonTypeSet(/* private fields */);Expand description
A set of JSON types.
Implementations§
Source§impl JsonTypeSet
impl JsonTypeSet
Sourcepub const fn empty() -> JsonTypeSet
pub const fn empty() -> JsonTypeSet
Create an empty set of types.
Sourcepub const fn all() -> JsonTypeSet
pub const fn all() -> JsonTypeSet
Create a set with all possible JSON types.
Sourcepub const fn insert(self, ty: JsonType) -> JsonTypeSet
pub const fn insert(self, ty: JsonType) -> JsonTypeSet
Add a type to this set and return the modified set.
Sourcepub const fn remove(self, ty: JsonType) -> JsonTypeSet
pub const fn remove(self, ty: JsonType) -> JsonTypeSet
Remove a type from this set and return the modified set.
Sourcepub const fn intersect(self, other: JsonTypeSet) -> JsonTypeSet
pub const fn intersect(self, other: JsonTypeSet) -> JsonTypeSet
Types in both sets.
Sourcepub const fn union(self, other: JsonTypeSet) -> JsonTypeSet
pub const fn union(self, other: JsonTypeSet) -> JsonTypeSet
Types in either set.
Sourcepub fn contains_value_type<F>(self, value: &<F as Json>::Node<'_>) -> boolwhere
F: Json,
pub fn contains_value_type<F>(self, value: &<F as Json>::Node<'_>) -> boolwhere
F: Json,
Whether a JSON value’s type is allowed by this set.
Sourcepub fn iter(&self) -> JsonTypeSetIterator ⓘ
pub fn iter(&self) -> JsonTypeSetIterator ⓘ
Get an iterator over the types in this set.
Trait Implementations§
Source§impl BitOr<JsonType> for JsonTypeSet
impl BitOr<JsonType> for JsonTypeSet
Source§type Output = JsonTypeSet
type Output = JsonTypeSet
The resulting type after applying the
| operator.Source§impl Clone for JsonTypeSet
impl Clone for JsonTypeSet
Source§fn clone(&self) -> JsonTypeSet
fn clone(&self) -> JsonTypeSet
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for JsonTypeSet
Source§impl Debug for JsonTypeSet
impl Debug for JsonTypeSet
Source§impl Default for JsonTypeSet
impl Default for JsonTypeSet
Source§fn default() -> JsonTypeSet
fn default() -> JsonTypeSet
Returns the “default value” for a type. Read more
impl Eq for JsonTypeSet
Source§impl From<JsonType> for JsonTypeSet
impl From<JsonType> for JsonTypeSet
Source§fn from(ty: JsonType) -> JsonTypeSet
fn from(ty: JsonType) -> JsonTypeSet
Converts to this type from the input type.
Source§impl Hash for JsonTypeSet
impl Hash for JsonTypeSet
Source§impl IntoIterator for &JsonTypeSet
impl IntoIterator for &JsonTypeSet
Source§type IntoIter = JsonTypeSetIterator
type IntoIter = JsonTypeSetIterator
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <&JsonTypeSet as IntoIterator>::IntoIter
fn into_iter(self) -> <&JsonTypeSet as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl IntoIterator for JsonTypeSet
impl IntoIterator for JsonTypeSet
Source§type IntoIter = JsonTypeSetIterator
type IntoIter = JsonTypeSetIterator
Which kind of iterator are we turning this into?
Source§fn into_iter(self) -> <JsonTypeSet as IntoIterator>::IntoIter
fn into_iter(self) -> <JsonTypeSet as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
Source§impl Ord for JsonTypeSet
impl Ord for JsonTypeSet
Source§fn cmp(&self, other: &JsonTypeSet) -> Ordering
fn cmp(&self, other: &JsonTypeSet) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for JsonTypeSet
impl PartialEq for JsonTypeSet
Source§impl PartialOrd for JsonTypeSet
impl PartialOrd for JsonTypeSet
impl StructuralPartialEq for JsonTypeSet
Auto Trait Implementations§
impl Freeze for JsonTypeSet
impl RefUnwindSafe for JsonTypeSet
impl Send for JsonTypeSet
impl Sync for JsonTypeSet
impl Unpin for JsonTypeSet
impl UnsafeUnpin for JsonTypeSet
impl UnwindSafe for JsonTypeSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.