pub struct PropertyDeclarationContext<'a> {
property_id: Option<PropertyIdRef<'a>>,
random_count: Cell<i32>,
}Expand description
Context for the property declaration that is currently being parsed.
Fields§
§property_id: Option<PropertyIdRef<'a>>Reference to the current property’s name/ID.
random_count: Cell<i32>Current count of random() functions that have been parsed so far
in the current property declaration. Used when a random() function
has a property-index-scoped key.
Implementations§
Source§impl<'a> PropertyDeclarationContext<'a>
impl<'a> PropertyDeclarationContext<'a>
fn set(&mut self, property_id: PropertyIdRef<'a>)
fn clear(&mut self)
Sourcepub fn property_id(&self) -> Option<PropertyIdRef<'a>>
pub fn property_id(&self) -> Option<PropertyIdRef<'a>>
The declaration being parsed, if any.
Sourcepub fn current_random_index(&self) -> i32
pub fn current_random_index(&self) -> i32
The index of the current random() function in this declaration.
Sourcepub fn increment_random_count(&self) -> i32
pub fn increment_random_count(&self) -> i32
Claims the next index for a random() function in this declaration. The index is 1-based and follows the order the functions appear in the parsed value.
Trait Implementations§
Source§impl<'a> Debug for PropertyDeclarationContext<'a>
impl<'a> Debug for PropertyDeclarationContext<'a>
Source§impl<'a> Default for PropertyDeclarationContext<'a>
impl<'a> Default for PropertyDeclarationContext<'a>
Source§fn default() -> PropertyDeclarationContext<'a>
fn default() -> PropertyDeclarationContext<'a>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<'a> !Freeze for PropertyDeclarationContext<'a>
impl<'a> !RefUnwindSafe for PropertyDeclarationContext<'a>
impl<'a> Send for PropertyDeclarationContext<'a>
impl<'a> !Sync for PropertyDeclarationContext<'a>
impl<'a> Unpin for PropertyDeclarationContext<'a>
impl<'a> UnsafeUnpin for PropertyDeclarationContext<'a>
impl<'a> UnwindSafe for PropertyDeclarationContext<'a>
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> 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 moreSource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
Source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
Source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
Source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert