Struct leo_ast::common::array_dimensions::ArrayDimensions [−][src]
A vector of positive numbers that represent array dimensions.
Can be used in an array [Type
] or an array initializer [Expression
].
Implementations
impl ArrayDimensions
[src]
pub fn push_usize(&mut self, number: usize)
[src]
Creates a new PositiveNumber
from the given usize
and Span
.
Appends the new PositiveNumber
to the array dimensions.
pub fn append(&mut self, other: &mut ArrayDimensions)
[src]
Appends a vector of array dimensions to the self array dimensions.
pub fn to_strings(&self) -> Vec<String>
[src]
Returns the array dimensions as strings.
pub fn is_empty(&self) -> bool
[src]
Returns true
if the all array dimensions have been removed.
This method is called after repeated calls to remove_first
.
pub fn is_zero(&self) -> bool
[src]
Returns true
if there is an array dimension equal to zero.
pub fn first(&self) -> Option<&PositiveNumber>
[src]
Returns the first dimension of the array.
pub fn remove_first(&mut self) -> Option<PositiveNumber>
[src]
Attempts to remove the first dimension from the array.
If the first dimension exists, then remove and return Some(PositiveNumber)
.
If the first dimension does not exist, then return None
.
pub fn remove_last(&mut self) -> Option<PositiveNumber>
[src]
Attempts to remove the last dimension from the array.
If the last dimension exists, then remove and return Some(PositiveNumber)
.
If the last dimension does not exist, then return None
.
Trait Implementations
impl Clone for ArrayDimensions
[src]
fn clone(&self) -> ArrayDimensions
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ArrayDimensions
[src]
impl Default for ArrayDimensions
[src]
fn default() -> ArrayDimensions
[src]
impl<'de> Deserialize<'de> for ArrayDimensions
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for ArrayDimensions
[src]
impl Eq for ArrayDimensions
[src]
impl<'ast> From<ArrayDimensions<'ast>> for ArrayDimensions
[src]
Create a new ArrayDimensions
from a GrammarArrayDimensions
in a Leo program file.
fn from(dimensions: GrammarArrayDimensions<'ast>) -> Self
[src]
impl<'ast> From<ArrayDimensions<'ast>> for ArrayDimensions
[src]
Create a new ArrayDimensions
from a InputArrayDimensions
in a Leo program file.
fn from(dimensions: InputArrayDimensions<'ast>) -> Self
[src]
impl Hash for ArrayDimensions
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<ArrayDimensions> for ArrayDimensions
[src]
fn eq(&self, other: &ArrayDimensions) -> bool
[src]
fn ne(&self, other: &ArrayDimensions) -> bool
[src]
impl Serialize for ArrayDimensions
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for ArrayDimensions
[src]
impl StructuralPartialEq for ArrayDimensions
[src]
Auto Trait Implementations
impl RefUnwindSafe for ArrayDimensions
[src]
impl Send for ArrayDimensions
[src]
impl Sync for ArrayDimensions
[src]
impl Unpin for ArrayDimensions
[src]
impl UnwindSafe for ArrayDimensions
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,