pub(crate) struct SectionRulesBuilder<T: Keyword> {
strict: bool,
rules: SectionRules<T>,
}Expand description
A builder for a set of section rules.
Fields§
§strict: boolHave we been told, explicitly, to reject unrecognized tokens?
rules: SectionRules<T>The rules we’re building.
Implementations§
Source§impl<T: Keyword> SectionRulesBuilder<T>
impl<T: Keyword> SectionRulesBuilder<T>
Sourcepub(crate) fn add(&mut self, t: TokenFmtBuilder<T>)
pub(crate) fn add(&mut self, t: TokenFmtBuilder<T>)
Add a rule to this SectionRulesBuilder, based on a TokenFmtBuilder.
Requires that no rule yet exists for the provided keyword.
Sourcepub(crate) fn reject_unrecognized(&mut self)
pub(crate) fn reject_unrecognized(&mut self)
Explicitly reject any unrecognized tokens.
To avoid errors, you must either explicitly reject unrecognized tokens, or you must define how they are handled.
Sourcepub(crate) fn build(self) -> SectionRules<T>
pub(crate) fn build(self) -> SectionRules<T>
Construct the SectionRules from this builder.
§Panics
Panics if you did not specify the behavior for unrecognized tokens,
using either reject_unrecognized or add(UNRECOGNIZED.rule()...)
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for SectionRulesBuilder<T>
impl<T> RefUnwindSafe for SectionRulesBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for SectionRulesBuilder<T>where
T: Send,
impl<T> Sync for SectionRulesBuilder<T>where
T: Sync,
impl<T> Unpin for SectionRulesBuilder<T>where
T: Unpin,
impl<T> UnsafeUnpin for SectionRulesBuilder<T>
impl<T> UnwindSafe for SectionRulesBuilder<T>where
T: UnwindSafe,
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