pub trait ItemSetMethods: Copy + Sized {
type Each: Sized;
type Field: Sized;
// Required methods
fn accumulate(
self,
acc: &mut Option<Self::Field>,
one: Self::Each,
) -> Result<(), EP>;
fn finish(
self,
acc: Option<Self::Field>,
item_keyword: &'static str,
) -> Result<Self::Field, EP>;
// Provided methods
fn is_intro_item_keyword(self, kw: KeywordRef<'_>) -> bool
where Self::Each: NetdocParseable { ... }
fn finish_subdoc(self, acc: Option<Self::Field>) -> Result<Self::Field, EP>
where Self::Each: NetdocParseable { ... }
}
Available on crate feature
parse2
only.Expand description
Methods for handling some multiplicity of Items
For use by macros.
During parsing, we accumulate into a value of type Option<Self::Field>
.
The semantics of this are item-set-implementation-dependent;
using a type which is generic over the field type in a simple way
allows the partially-parsed accumulation state for a whole netdoc to have a concrete type.
See ItemSetSelector
and the module-level docs.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn is_intro_item_keyword(self, kw: KeywordRef<'_>) -> boolwhere
Self::Each: NetdocParseable,
fn is_intro_item_keyword(self, kw: KeywordRef<'_>) -> boolwhere
Self::Each: NetdocParseable,
If the contained type is a sub-document, call its is_intro_item_keyword
.
Sourcefn finish_subdoc(self, acc: Option<Self::Field>) -> Result<Self::Field, EP>where
Self::Each: NetdocParseable,
fn finish_subdoc(self, acc: Option<Self::Field>) -> Result<Self::Field, EP>where
Self::Each: NetdocParseable,
finish
for if the contained type is a wsub-document
Obtain the sub-document’s intro keyword from its doctype_for_error
.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.