pub struct Array(/* private fields */);
Expand description
Subtype of Value
that represents an array
Implementations§
source§impl Array
impl Array
sourcepub const MAX_CONVERTIBLE_RANGE: usize = 65_536usize
pub const MAX_CONVERTIBLE_RANGE: usize = 65_536usize
Largest range that can be converted to an array
sourcepub fn get_mut(&mut self, index: usize) -> Option<&mut Value>
pub fn get_mut(&mut self, index: usize) -> Option<&mut Value>
Get a mutable value from the array, if it exists
sourcepub fn prealloc_range_conversion(length: usize) -> Result<Self, Error>
pub fn prealloc_range_conversion(length: usize) -> Result<Self, Error>
Preallocate space for a large array conversion
Trait Implementations§
source§impl ArithmeticOperationExt for Array
impl ArithmeticOperationExt for Array
source§fn arithmetic_op(
self,
right: Self,
operation: ArithmeticOperation
) -> Result<Self, Error>
fn arithmetic_op( self, right: Self, operation: ArithmeticOperation ) -> Result<Self, Error>
Perform an arithmetic operation on two values
If the operation is not supported on the given type,
an
Error::UnsupportedOperation
will be returned Read moresource§impl BooleanOperationExt for Array
impl BooleanOperationExt for Array
source§fn boolean_op(
self,
right: Self,
operation: BooleanOperation
) -> Result<Value, Error>
fn boolean_op( self, right: Self, operation: BooleanOperation ) -> Result<Value, Error>
Perform a boolean operation on two values
If the operation is not supported on the given type,
an
Error::UnsupportedOperation
will be returned Read moresource§impl<'de> Deserialize<'de> for Array
impl<'de> Deserialize<'de> for Array
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl IndexingMutationExt for Array
impl IndexingMutationExt for Array
source§fn get_index_mut(&mut self, index: &Value) -> Result<&mut Value, Error>
fn get_index_mut(&mut self, index: &Value) -> Result<&mut Value, Error>
Get a value from an index
Returns a mutable reference to the value, or an
Error::Index
if the index is not found Read moresource§fn get_indices_mut(&mut self, index: &Value) -> Result<Vec<&mut Value>, Error>
fn get_indices_mut(&mut self, index: &Value) -> Result<Vec<&mut Value>, Error>
Get values from one or more indices, mutably
Returns a vector of references to the values, or an
Error::Index
if any of the indices are not found Read moresource§fn set_index(&mut self, index: &Value, value: Value) -> Result<(), Error>
fn set_index(&mut self, index: &Value, value: Value) -> Result<(), Error>
Set a value at an index
Returns an
Error::Index
if the index is not found Read moresource§impl IndexingOperationExt for Array
impl IndexingOperationExt for Array
source§impl Into<Vec<Value>> for Array
impl Into<Vec<Value>> for Array
source§fn into(self) -> ArrayInner
fn into(self) -> ArrayInner
Converts this type into the (usually inferred) input type.
source§impl MatchingOperationExt for Array
impl MatchingOperationExt for Array
source§impl Ord for Array
impl Ord for Array
source§impl PartialEq for Array
impl PartialEq for Array
source§impl PartialOrd for Array
impl PartialOrd for Array
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl ValueTrait for Array
impl ValueTrait for Array
source§fn new(inner: ArrayInner) -> Self
fn new(inner: ArrayInner) -> Self
Creates a new value from the given inner value
source§fn inner(&self) -> &ArrayInner
fn inner(&self) -> &ArrayInner
Returns a reference to the inner value
source§fn inner_mut(&mut self) -> &mut ArrayInner
fn inner_mut(&mut self) -> &mut ArrayInner
Returns a mutable reference to the inner value
source§fn into_inner(self) -> ArrayInner
fn into_inner(self) -> ArrayInner
Consumes the value and returns the inner value
impl Eq for Array
impl StructuralPartialEq for Array
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnwindSafe for Array
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