RuleObject

Struct RuleObject 

Source
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>

Source

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.

Source

pub const fn of<T: Rule>() -> &'lt Self

Creates an unbounded reference to a RuleObject for T.

Source

pub fn name(&self) -> &str

The name of the rule.

Source

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>

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl<Cx: CxType> Debug for RuleObject<'_, Cx>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'lt, Cx: CxType> Default for &'lt RuleObject<'lt, Cx>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<Cx: CxType> Default for RuleObject<'_, Cx>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.