Skip to main content

WithIterator

Struct WithIterator 

Source
pub struct WithIterator<T: TypeSet> {
    pub inner: T,
}
Expand description

A TypeSet wrapper that adds iterator support to the wrapped type set T.

All scalar behavior is delegated to T; this only replaces the inert NoIterator with a real SomniIterator and implements the iter_has_next / iter_next protocol.

Fields§

§inner: T

The inner type set.

Trait Implementations§

Source§

impl<T: TypeSet> Debug for WithIterator<T>

Source§

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

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

impl<T: TypeSet> Default for WithIterator<T>

Source§

fn default() -> Self

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

impl<T> LoadStore<WithIterator<T>> for SomniIterator<T>
where T: TypeSet, WithIterator<T>: TypeSet<Iterator = SomniIterator<T>>,

Source§

type Output<'s> = SomniIterator<T>

The type of the result.
Source§

fn load<'s>( _ctx: &'s WithIterator<T>, typed: &'s TypedValue<WithIterator<T>>, ) -> Option<Self::Output<'s>>

Loads a borrowed value from the given type context.
Source§

fn store(&self, _ctx: &mut WithIterator<T>) -> TypedValue<WithIterator<T>>

Stores a Rust value into a TypedValue using the given type context.
Source§

impl TypeSet for WithIterator<DefaultTypeSet>

Source§

type Parser = <DefaultTypeSet as TypeSet>::Parser

The typeset that will be used to parse source code.
Source§

type Integer = <DefaultTypeSet as TypeSet>::Integer

The type of unsigned integers in this type set.
Source§

type SignedInteger = <DefaultTypeSet as TypeSet>::SignedInteger

The type of signed integers in this type set.
Source§

type Float = <DefaultTypeSet as TypeSet>::Float

The type of floating point numbers in this type set.
Source§

type String = <DefaultTypeSet as TypeSet>::String

The type of a string in this type set.
Source§

type Iterator = SomniIterator<DefaultTypeSet>

The type of an iterator value in this type set. Read more
Source§

fn to_signed(v: Self::Integer) -> Result<Self::SignedInteger, OperatorError>

Converts an unsigned integer into a signed integer.
Source§

fn to_usize(v: Self::Integer) -> Result<usize, OperatorError>

Converts an unsigned integer into a Rust usize.
Source§

fn int_from_usize(v: usize) -> Self::Integer

Converts the given Rust usize to an integer.
Source§

fn load_string<'s>(&'s self, str: &'s Self::String) -> &'s str

Loads a string.
Source§

fn store_string(&mut self, str: &str) -> Self::String

Stores a string.
Source§

fn iter_has_next(&self, iter: &Self::Iterator) -> bool

Returns whether the given iterator can yield another value.
Source§

fn iter_next(&self, iter: &Self::Iterator) -> Option<TypedValue<Self>>

Advances the given iterator, returning its next value, or None if the iterator is exhausted.
Source§

impl TypeSet for WithIterator<TypeSet32>

Source§

type Parser = <TypeSet32 as TypeSet>::Parser

The typeset that will be used to parse source code.
Source§

type Integer = <TypeSet32 as TypeSet>::Integer

The type of unsigned integers in this type set.
Source§

type SignedInteger = <TypeSet32 as TypeSet>::SignedInteger

The type of signed integers in this type set.
Source§

type Float = <TypeSet32 as TypeSet>::Float

The type of floating point numbers in this type set.
Source§

type String = <TypeSet32 as TypeSet>::String

The type of a string in this type set.
Source§

type Iterator = SomniIterator<TypeSet32>

The type of an iterator value in this type set. Read more
Source§

fn to_signed(v: Self::Integer) -> Result<Self::SignedInteger, OperatorError>

Converts an unsigned integer into a signed integer.
Source§

fn to_usize(v: Self::Integer) -> Result<usize, OperatorError>

Converts an unsigned integer into a Rust usize.
Source§

fn int_from_usize(v: usize) -> Self::Integer

Converts the given Rust usize to an integer.
Source§

fn load_string<'s>(&'s self, str: &'s Self::String) -> &'s str

Loads a string.
Source§

fn store_string(&mut self, str: &str) -> Self::String

Stores a string.
Source§

fn iter_has_next(&self, iter: &Self::Iterator) -> bool

Returns whether the given iterator can yield another value.
Source§

fn iter_next(&self, iter: &Self::Iterator) -> Option<TypedValue<Self>>

Advances the given iterator, returning its next value, or None if the iterator is exhausted.
Source§

impl TypeSet for WithIterator<TypeSet128>

Source§

type Parser = <TypeSet128 as TypeSet>::Parser

The typeset that will be used to parse source code.
Source§

type Integer = <TypeSet128 as TypeSet>::Integer

The type of unsigned integers in this type set.
Source§

type SignedInteger = <TypeSet128 as TypeSet>::SignedInteger

The type of signed integers in this type set.
Source§

type Float = <TypeSet128 as TypeSet>::Float

The type of floating point numbers in this type set.
Source§

type String = <TypeSet128 as TypeSet>::String

The type of a string in this type set.
Source§

type Iterator = SomniIterator<TypeSet128>

The type of an iterator value in this type set. Read more
Source§

fn to_signed(v: Self::Integer) -> Result<Self::SignedInteger, OperatorError>

Converts an unsigned integer into a signed integer.
Source§

fn to_usize(v: Self::Integer) -> Result<usize, OperatorError>

Converts an unsigned integer into a Rust usize.
Source§

fn int_from_usize(v: usize) -> Self::Integer

Converts the given Rust usize to an integer.
Source§

fn load_string<'s>(&'s self, str: &'s Self::String) -> &'s str

Loads a string.
Source§

fn store_string(&mut self, str: &str) -> Self::String

Stores a string.
Source§

fn iter_has_next(&self, iter: &Self::Iterator) -> bool

Returns whether the given iterator can yield another value.
Source§

fn iter_next(&self, iter: &Self::Iterator) -> Option<TypedValue<Self>>

Advances the given iterator, returning its next value, or None if the iterator is exhausted.

Auto Trait Implementations§

§

impl<T> Freeze for WithIterator<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for WithIterator<T>
where T: RefUnwindSafe,

§

impl<T> Send for WithIterator<T>
where T: Send,

§

impl<T> Sync for WithIterator<T>
where T: Sync,

§

impl<T> Unpin for WithIterator<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for WithIterator<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for WithIterator<T>
where T: UnwindSafe,

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