pub struct NsSet(/* private fields */);Expand description
Implementations§
Source§impl NsSet
impl NsSet
Sourcepub const fn of(namespaces: &[Namespace]) -> Self
pub const fn of(namespaces: &[Namespace]) -> Self
A set holding exactly namespaces.
§Examples
use resolve_lang::{Namespace, NsSet};
assert_eq!(NsSet::of(&[Namespace::Value]), NsSet::single(Namespace::Value));Sourcepub const fn single(ns: Namespace) -> Self
pub const fn single(ns: Namespace) -> Self
A set holding one namespace.
§Examples
use resolve_lang::{Namespace, NsSet};
assert!(NsSet::single(Namespace::Macro).contains(Namespace::Macro));Sourcepub const fn contains(self, ns: Namespace) -> bool
pub const fn contains(self, ns: Namespace) -> bool
Whether ns is in the set.
§Examples
use resolve_lang::{Namespace, NsSet};
assert!(!NsSet::EMPTY.contains(Namespace::Value));Sourcepub const fn is_empty(self) -> bool
pub const fn is_empty(self) -> bool
Whether the set is empty.
§Examples
use resolve_lang::{Namespace, NsSet};
assert!(!NsSet::single(Namespace::Type).is_empty());Trait Implementations§
impl Copy for NsSet
impl Eq for NsSet
impl StructuralPartialEq for NsSet
Auto Trait Implementations§
impl Freeze for NsSet
impl RefUnwindSafe for NsSet
impl Send for NsSet
impl Sync for NsSet
impl Unpin for NsSet
impl UnsafeUnpin for NsSet
impl UnwindSafe for NsSet
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