pub struct SymbolAccess {
pub span: SourceSpan,
pub name: ResolvableIdentifier,
pub access_type: AccessType,
pub offset: usize,
pub ty: Option<Type>,
}Expand description
SymbolAccess represents access to a named item in the source code; one of the following:
- A global name associated with trace columns or public inputs
- A named constant
- A module-local name associated with periodic columns
- A evaluator/function parameter
- A let-bound variable
Fields§
§span: SourceSpan§name: ResolvableIdentifierThe symbol being accessed
access_type: AccessTypeThe type of access
offset: usizeUsed when the accessing a trace column with ', indicates the offset from
the current row in the trace. Defaults to zero.
NOTE: When accessed with an offset, trace columns are treated as scalar values, not as trace columns proper. What this means is that such an access cannot be used in a context where a trace column is expected, only where a scalar value is expected.
ty: Option<Type>Used during name resolution/type checking to store the type associated with the value produced by the symbol access. If unset, it simply means that the type has not been checked/resolved.
Implementations§
Source§impl SymbolAccess
impl SymbolAccess
pub const fn new( span: SourceSpan, name: Identifier, access_type: AccessType, offset: usize, ) -> Self
Sourcepub fn access(
&self,
access_type: AccessType,
) -> Result<Self, InvalidAccessError>
pub fn access( &self, access_type: AccessType, ) -> Result<Self, InvalidAccessError>
Generates a new SymbolAccess that represents accessing this access, i.e.
nesting accesses. For example, if called with AccessType::Index, and
the current access type is Default, a new SymbolAccess is returned which
has an access type of Index. However, if the current access type was Index,
then the resulting SymbolAccess will have an access type of Matrix
It is expected that the type of this access has been resolved already, and this function will panic if that is not the case.
Trait Implementations§
Source§impl Clone for SymbolAccess
impl Clone for SymbolAccess
Source§fn clone(&self) -> SymbolAccess
fn clone(&self) -> SymbolAccess
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SymbolAccess
impl Debug for SymbolAccess
Source§impl Display for SymbolAccess
impl Display for SymbolAccess
Source§impl From<SymbolAccess> for Expr
impl From<SymbolAccess> for Expr
Source§fn from(expr: SymbolAccess) -> Self
fn from(expr: SymbolAccess) -> Self
Source§impl PartialEq for SymbolAccess
impl PartialEq for SymbolAccess
Source§impl Spanned for SymbolAccess
impl Spanned for SymbolAccess
fn span(&self) -> SourceSpan
impl Eq for SymbolAccess
Auto Trait Implementations§
impl Freeze for SymbolAccess
impl RefUnwindSafe for SymbolAccess
impl Send for SymbolAccess
impl Sync for SymbolAccess
impl Unpin for SymbolAccess
impl UnwindSafe for SymbolAccess
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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