pub struct RuleObject<'lt, Cx: CxType> { /* private fields */ }Expand description
An object dynamically representing an implementation of Rule.
Implementations§
Source§impl<'lt, Cx: CxType> RuleObject<'lt, Cx>
impl<'lt, Cx: CxType> RuleObject<'lt, Cx>
Sourcepub fn new<T: Rule>(next: impl Into<Option<&'lt Self>>) -> Self
pub fn new<T: Rule>(next: impl Into<Option<&'lt Self>>) -> Self
Creates a RuleObject for rule T, which may be followed by another RuleObject next.
Sourcepub const fn of<T: Rule>() -> &'lt Self
pub const fn of<T: Rule>() -> &'lt Self
Creates an unbounded reference to a RuleObject for T.
Sourcepub fn pre_parse(
&self,
cx: ParseContext<'_, '_, Cx>,
state: PreParseState,
) -> RuleParseResult<()>
pub fn pre_parse( &self, cx: ParseContext<'_, '_, Cx>, state: PreParseState, ) -> RuleParseResult<()>
Begins evaluating this rule, stopping when the lookahead buffer is full.
Trait Implementations§
Source§impl<'lt, Cx: Clone + CxType> Clone for RuleObject<'lt, Cx>
impl<'lt, Cx: Clone + CxType> Clone for RuleObject<'lt, Cx>
Source§fn clone(&self) -> RuleObject<'lt, Cx>
fn clone(&self) -> RuleObject<'lt, Cx>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Cx: CxType> Debug for RuleObject<'_, Cx>
impl<Cx: CxType> Debug for RuleObject<'_, Cx>
Source§impl<'lt, Cx: CxType> Default for &'lt RuleObject<'lt, Cx>
impl<'lt, Cx: CxType> Default for &'lt RuleObject<'lt, Cx>
Source§impl<Cx: CxType> Default for RuleObject<'_, Cx>
impl<Cx: CxType> Default for RuleObject<'_, Cx>
impl<'lt, Cx: Copy + CxType> Copy for RuleObject<'lt, Cx>
Auto Trait Implementations§
impl<'lt, Cx> Freeze for RuleObject<'lt, Cx>
impl<'lt, Cx> !RefUnwindSafe for RuleObject<'lt, Cx>
impl<'lt, Cx> !Send for RuleObject<'lt, Cx>
impl<'lt, Cx> !Sync for RuleObject<'lt, Cx>
impl<'lt, Cx> Unpin for RuleObject<'lt, Cx>
impl<'lt, Cx> !UnwindSafe for RuleObject<'lt, Cx>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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