pub struct MultiplicitySelector<Field>(PhantomData<fn(Field)>);Expand description
Helper type that allows us to select an impl of MultiplicityMethods
For use by macros.
This is distinct from parse2::MultiplicitySelector,
principally because it has the opposite variance.
Tuple Fields§
§0: PhantomData<fn(Field)>Implementations§
Source§impl<T> MultiplicitySelector<Vec<T>>
impl<T> MultiplicitySelector<Vec<T>>
Sourcepub fn selector(self) -> DeterminedMultiplicitySelector<Vec<T>>
pub fn selector(self) -> DeterminedMultiplicitySelector<Vec<T>>
Return the appropriate implementor of MultiplicityMethods
This is an inherent method so that it doesn’t need the EncodeOrd bounds:
that way if EncodeOrd is not implemented, we get a message about that,
rather than a complaint that ItemValueEncodable isn’t impl for Vec<T>.
Trait Implementations§
Source§impl<Field> Clone for MultiplicitySelector<Field>
impl<Field> Clone for MultiplicitySelector<Field>
Source§impl<Field> Default for MultiplicitySelector<Field>
impl<Field> Default for MultiplicitySelector<Field>
Source§impl<'f, T: 'f> MultiplicityMethods<'f> for &MultiplicitySelector<T>
impl<'f, T: 'f> MultiplicityMethods<'f> for &MultiplicitySelector<T>
Source§fn iter_ordered(
self,
f: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each> + 'f
fn iter_ordered( self, f: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each> + 'f
Yield the items, in a stable order
Source§fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
Cause a compiler error if the element is not
NetdocEncodableSource§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
Cause a compiler error if the element is not
ItemArgumentSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<BTreeSet<T>>
impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<BTreeSet<T>>
Source§fn iter_ordered(
self,
f: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each>
fn iter_ordered( self, f: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each>
Yield the items, in a stable order
Source§fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
Cause a compiler error if the element is not
NetdocEncodableSource§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
Cause a compiler error if the element is not
ItemArgumentSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<'f> MultiplicityMethods<'f> for MultiplicitySelector<Ignored>
impl<'f> MultiplicityMethods<'f> for MultiplicitySelector<Ignored>
Source§type Each = IgnoredItemOrObjectValue
type Each = IgnoredItemOrObjectValue
The value for each thing.
Source§fn iter_ordered(
self,
_: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each>
fn iter_ordered( self, _: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each>
Yield the items, in a stable order
Source§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<'f> MultiplicityMethods<'f> for MultiplicitySelector<NotPresent>
impl<'f> MultiplicityMethods<'f> for MultiplicitySelector<NotPresent>
Source§type Field = NotPresent
type Field = NotPresent
The input type: the type of the field in the netdoc or item struct.
Source§fn iter_ordered(
self,
_: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each>
fn iter_ordered( self, _: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each>
Yield the items, in a stable order
Source§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<Option<T>>
impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<Option<T>>
Source§fn iter_ordered(
self,
f: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each> + 'f
fn iter_ordered( self, f: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each> + 'f
Yield the items, in a stable order
Source§fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
Cause a compiler error if the element is not
NetdocEncodableSource§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
Cause a compiler error if the element is not
ItemArgumentSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<RetainedOrderVec<T>>
impl<'f, T: 'f> MultiplicityMethods<'f> for MultiplicitySelector<RetainedOrderVec<T>>
Source§type Field = RetainedOrderVec<T>
type Field = RetainedOrderVec<T>
The input type: the type of the field in the netdoc or item struct.
Source§fn iter_ordered(
self,
f: &'f Self::Field,
) -> impl Iterator<Item = &'f Self::Each>
fn iter_ordered( self, f: &'f Self::Field, ) -> impl Iterator<Item = &'f Self::Each>
Yield the items, in a stable order
Source§fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
fn check_netdoc_encodable(self)where
Self::Each: NetdocEncodable,
Cause a compiler error if the element is not
NetdocEncodableSource§fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
fn check_item_value_encodable(self)where
Self::Each: ItemValueEncodable,
Cause a compiler error if the element is not
ItemValueEncodableSource§fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
fn check_item_argument_encodable(self)where
Self::Each: ItemArgument,
Cause a compiler error if the element is not
ItemArgumentSource§fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
fn check_item_object_encodable(self)where
Self::Each: ItemObjectEncodable,
Cause a compiler error if the element is not
ItemObjectEncodableSource§impl<T: 'static> OptionalityMethods for &MultiplicitySelector<T>
impl<T: 'static> OptionalityMethods for &MultiplicitySelector<T>
Source§impl<T: 'static> OptionalityMethods for MultiplicitySelector<Option<T>>
impl<T: 'static> OptionalityMethods for MultiplicitySelector<Option<T>>
impl<Field> Copy for MultiplicitySelector<Field>
Auto Trait Implementations§
impl<Field> Freeze for MultiplicitySelector<Field>
impl<Field> RefUnwindSafe for MultiplicitySelector<Field>
impl<Field> Send for MultiplicitySelector<Field>
impl<Field> Sync for MultiplicitySelector<Field>
impl<Field> Unpin for MultiplicitySelector<Field>
impl<Field> UnsafeUnpin for MultiplicitySelector<Field>
impl<Field> UnwindSafe for MultiplicitySelector<Field>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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)
Converts
&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)
Converts
&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<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>
Converts
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>
Converts
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