pub struct ResolvedArrayType { /* private fields */ }Expand description
The resolved descriptor for one complete array type annotation.
Implementations§
Source§impl ResolvedArrayType
impl ResolvedArrayType
Sourcepub fn from_element_type(element_type: ValueType) -> Self
pub fn from_element_type(element_type: ValueType) -> Self
Creates a resolved array type from its already-resolved element descriptor.
-
Precondition:
element_typeretains a concrete canonical factory. -
Postcondition:
element_typereturnselement_typeunchanged, so the result describes an array whose elements have exactly that type.
§Examples
use cel_parser::ResolvedArrayType;
use cel_runtime::ValueType;
let array = ResolvedArrayType::from_element_type(ValueType::leaf::<i32>());
assert_eq!(array.element_type().type_name(), "i32");Sourcepub fn from_resolved_type(
resolved: ResolvedType,
span: ExprSpan,
) -> Result<Self>
pub fn from_resolved_type( resolved: ResolvedType, span: ExprSpan, ) -> Result<Self>
Creates a resolved array type from a fully resolved recursive type expression.
§Errors
Returns Err if resolved is not an array type or its layout is unrepresentable.
Sourcepub fn element_type(&self) -> &ValueType
pub fn element_type(&self) -> &ValueType
Returns the recursive element descriptor this array annotation resolves to.
Sourcepub fn into_element_type(self) -> ValueType
pub fn into_element_type(self) -> ValueType
Returns the recursive element descriptor, consuming self.
Trait Implementations§
Source§impl Clone for ResolvedArrayType
impl Clone for ResolvedArrayType
Source§fn clone(&self) -> ResolvedArrayType
fn clone(&self) -> ResolvedArrayType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ResolvedArrayType
impl Debug for ResolvedArrayType
Auto Trait Implementations§
impl Freeze for ResolvedArrayType
impl RefUnwindSafe for ResolvedArrayType
impl Send for ResolvedArrayType
impl Sync for ResolvedArrayType
impl Unpin for ResolvedArrayType
impl UnsafeUnpin for ResolvedArrayType
impl UnwindSafe for ResolvedArrayType
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