pub struct NotPresent;Expand description
Part of a network document, that isn’t actually there.
Used as a standin in ns_type! calls in various netstatus each_variety.rs.
The effect is as if the field were omitted from the containing type.
-
When used as item(s) (ie, a field type when deriving
NetdocParseable\[Fields\]): ignores any number of items with that field’s keyword during parsing, and emits none during encoding.(To reject documents containing this item, use
Option<Void>, but note that the spec says unknown items should be ignored, which would normally include items which are merely missing from one variety.) -
When used as an argument (ie, a field type when deriving
ItemValueParseable, or withnetdoc(single_arg)when derivingNetdocParseable\[Fields\]): consumes no arguments during parsing, and emits none during encoding. -
When used as an object field (ie,
netdoc(object)when derivingItemValueParseable): rejects an object - failing the parse if one is present. (Functions similarly toOption<Void>, but preferNotPresentas it’s clearer.)
There are bespoke impls of the multiplicity traits
ItemSetMethods and ObjectSetMethods:
don’t wrap this type in Option or Vec.
Trait Implementations§
Source§impl Clone for NotPresent
impl Clone for NotPresent
Source§fn clone(&self) -> NotPresent
fn clone(&self) -> NotPresent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NotPresent
impl Debug for NotPresent
Source§impl Default for NotPresent
impl Default for NotPresent
Source§fn default() -> NotPresent
fn default() -> NotPresent
Source§impl Hash for NotPresent
impl Hash for NotPresent
Source§impl ItemArgumentParseable for NotPresent
Available on crate feature parse2 only.
impl ItemArgumentParseable for NotPresent
parse2 only.Source§fn from_args(_: &mut ArgumentStream<'_>) -> Result<NotPresent, ArgumentError>
fn from_args(_: &mut ArgumentStream<'_>) -> Result<NotPresent, ArgumentError>
Source§impl NetdocParseableFields for NotPresent
impl NetdocParseableFields for NotPresent
Source§type Accumulator = NotPresentNetdocParseAccumulator
type Accumulator = NotPresentNetdocParseAccumulator
parse2 only.Source§fn is_item_keyword(kw: KeywordRef<'_>) -> bool
fn is_item_keyword(kw: KeywordRef<'_>) -> bool
parse2 only.Source§fn accumulate_item(
acc: &mut Self::Accumulator,
item: UnparsedItem<'_>,
) -> Result<(), ErrorProblem>
fn accumulate_item( acc: &mut Self::Accumulator, item: UnparsedItem<'_>, ) -> Result<(), ErrorProblem>
parse2 only.Source§fn finish(acc: Self::Accumulator) -> Result<Self, ErrorProblem>
fn finish(acc: Self::Accumulator) -> Result<Self, ErrorProblem>
parse2 only.Source§impl Ord for NotPresent
impl Ord for NotPresent
Source§fn cmp(&self, other: &NotPresent) -> Ordering
fn cmp(&self, other: &NotPresent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for NotPresent
impl PartialEq for NotPresent
Source§impl PartialOrd for NotPresent
impl PartialOrd for NotPresent
impl Copy for NotPresent
impl Eq for NotPresent
impl StructuralPartialEq for NotPresent
Auto Trait Implementations§
impl Freeze for NotPresent
impl RefUnwindSafe for NotPresent
impl Send for NotPresent
impl Sync for NotPresent
impl Unpin for NotPresent
impl UnwindSafe for NotPresent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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