Struct ArrayDimensions
pub struct ArrayDimensions {
pub size: Option<u32>,
pub lower_bound: Option<u32>,
}Expand description
Represents a single dimension of a multi-dimensional array with optional size and bounds.
In .NET, arrays can have multiple dimensions with configurable lower bounds and sizes. This structure captures the metadata for a single dimension of such an array.
§Fields
size: The number of elements in this dimension (if known at compile time)lower_bound: The lowest valid index for this dimension (typically 0)
§Examples
use dotscope::metadata::typesystem::ArrayDimensions;
// A dimension with 10 elements starting at index 0
let dim = ArrayDimensions {
size: Some(10),
lower_bound: Some(0),
};
// An unbounded dimension (size determined at runtime)
let unbounded = ArrayDimensions {
size: None,
lower_bound: Some(1), // 1-based indexing
};§References
Fields§
§size: Option<u32>The size of this dimension (number of elements).
None indicates the size is not fixed at compile time and will be
determined at runtime when the array is allocated.
lower_bound: Option<u32>The lower bound of this dimension (lowest index that can be used to access an element).
Most .NET arrays use 0-based indexing, but the runtime supports arbitrary lower bounds.
None typically means the lower bound is 0.
Trait Implementations§
§impl Clone for ArrayDimensions
impl Clone for ArrayDimensions
§fn clone(&self) -> ArrayDimensions
fn clone(&self) -> ArrayDimensions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for ArrayDimensions
impl Debug for ArrayDimensions
§impl Default for ArrayDimensions
impl Default for ArrayDimensions
§fn default() -> ArrayDimensions
fn default() -> ArrayDimensions
Returns the “default value” for a type. Read more
§impl PartialEq for ArrayDimensions
impl PartialEq for ArrayDimensions
impl StructuralPartialEq for ArrayDimensions
Auto Trait Implementations§
impl Freeze for ArrayDimensions
impl RefUnwindSafe for ArrayDimensions
impl Send for ArrayDimensions
impl Sync for ArrayDimensions
impl Unpin for ArrayDimensions
impl UnwindSafe for ArrayDimensions
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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