Struct liquid_lib::stdlib::ForloopObject

source ·
pub struct ForloopObject<'p> { /* private fields */ }
Available on crate feature stdlib only.

Implementations§

source§

impl<'p> ForloopObject<'p>

source

pub fn new(i: usize, len: usize) -> Self

Trait Implementations§

source§

impl<'p> Clone for ForloopObject<'p>

source§

fn clone(&self) -> ForloopObject<'p>

Returns a copy 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<'p> Debug for ForloopObject<'p>

source§

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

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

impl<'p> ObjectView for ForloopObject<'p>

source§

fn as_value(&self) -> &dyn ValueView

Cast to ValueView
source§

fn size(&self) -> i64

Returns the number of elements.
source§

fn keys<'liquid_derive_k>( &'liquid_derive_k self ) -> Box<dyn Iterator<Item = KStringCow<'liquid_derive_k>> + 'liquid_derive_k>

Keys available for lookup.
source§

fn values<'liquid_derive_k>( &'liquid_derive_k self ) -> Box<dyn Iterator<Item = &'liquid_derive_k dyn ValueView> + 'liquid_derive_k>

Keys available for lookup.
source§

fn iter<'liquid_derive_k>( &'liquid_derive_k self ) -> Box<dyn Iterator<Item = (KStringCow<'liquid_derive_k>, &'liquid_derive_k dyn ValueView)> + 'liquid_derive_k>

Returns an iterator .
source§

fn contains_key(&self, index: &str) -> bool

Access a contained BoxedValue.
source§

fn get<'liquid_derive_s>( &'liquid_derive_s self, index: &str ) -> Option<&'liquid_derive_s dyn ValueView>

Access a contained Value.
source§

impl<'p> ValueView for ForloopObject<'p>

source§

fn as_debug(&self) -> &dyn Debug

Get a Debug representation
source§

fn render(&self) -> DisplayCow<'_>

A Display for a BoxedValue rendered for the user.
source§

fn source(&self) -> DisplayCow<'_>

A Display for a Value as source code.
source§

fn type_name(&self) -> &'static str

Report the data type (generally for error reporting).
source§

fn query_state(&self, state: State) -> bool

Query the value’s state
source§

fn to_kstr(&self) -> KStringCow<'_>

Interpret as a string.
source§

fn to_value(&self) -> Value

Convert to an owned type.
source§

fn as_object(&self) -> Option<&dyn ObjectView>

Extracts the object value if it is a object.
source§

fn as_scalar(&self) -> Option<ScalarCow<'_>>

Extracts the scalar value if it is a scalar.
source§

fn is_scalar(&self) -> bool

Tests whether this value is a scalar
source§

fn as_array(&self) -> Option<&dyn ArrayView>

Extracts the array value if it is an array.
source§

fn is_array(&self) -> bool

Tests whether this value is an array
source§

fn is_object(&self) -> bool

Tests whether this value is an object
source§

fn as_state(&self) -> Option<State>

Extracts the state if it is one
source§

fn is_state(&self) -> bool

Tests whether this value is state
source§

fn is_nil(&self) -> bool

Tests whether this value is nil Read more

Auto Trait Implementations§

§

impl<'p> Freeze for ForloopObject<'p>

§

impl<'p> !RefUnwindSafe for ForloopObject<'p>

§

impl<'p> !Send for ForloopObject<'p>

§

impl<'p> !Sync for ForloopObject<'p>

§

impl<'p> Unpin for ForloopObject<'p>

§

impl<'p> !UnwindSafe for ForloopObject<'p>

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

§

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

§

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

§

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.
source§

impl<T> Any for T
where T: Any,

source§

impl<T> CloneAny for T
where T: Any + Clone,