pub struct AbstractComprehensionBuilder {
pub qualifiers: Vec<Qualifier>,
pub return_expr_symbols: Rc<RefCell<SymbolTable>>,
pub generator_symbols: Rc<RefCell<SymbolTable>>,
}Fields§
§qualifiers: Vec<Qualifier>§return_expr_symbols: Rc<RefCell<SymbolTable>>The symbol table used in the return expression.
Variables from generator expressions are “given” in the context of the return expression. That is, they are constants which are different for each expansion of the comprehension.
generator_symbols: Rc<RefCell<SymbolTable>>The scope for variables in generator expressions.
Variables declared in generator expressions are decision variables in their original context, since they do not have a constant value.
Implementations§
Source§impl AbstractComprehensionBuilder
impl AbstractComprehensionBuilder
Sourcepub fn new(symbols: &Rc<RefCell<SymbolTable>>) -> Self
pub fn new(symbols: &Rc<RefCell<SymbolTable>>) -> Self
Creates an AbstractComprehensionBuilder with:
- An inner scope which inherits from the given symbol table
- An empty list of qualifiers
Changes to the inner scope do not affect the given symbol table.
The return expression is passed when finalizing the comprehension, in [with_return_value].
pub fn return_expr_symbols(&self) -> Rc<RefCell<SymbolTable>>
pub fn generator_symbols(&self) -> Rc<RefCell<SymbolTable>>
pub fn new_domain_generator(&mut self, domain: DomainPtr) -> DeclarationPtr
Sourcepub fn new_expression_generator(self, expr: Expression, name: Name) -> Self
pub fn new_expression_generator(self, expr: Expression, name: Name) -> Self
Creates a new expression generator with the given expression and variable name.
The variable “takes from” the expression, that is, it can be any element in the expression.
E.g. in [ x | x <- some_set ], x can be any element of some_set.
Sourcepub fn add_condition(&mut self, condition: Expression)
pub fn add_condition(&mut self, condition: Expression)
pub fn new_letting(&mut self, expression: Expression) -> DeclarationPtr
pub fn with_return_value(self, expression: Expression) -> AbstractComprehension
Auto Trait Implementations§
impl Freeze for AbstractComprehensionBuilder
impl !RefUnwindSafe for AbstractComprehensionBuilder
impl !Send for AbstractComprehensionBuilder
impl !Sync for AbstractComprehensionBuilder
impl Unpin for AbstractComprehensionBuilder
impl !UnwindSafe for AbstractComprehensionBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes