pub struct LimitedVarArray<T, const N: i32>(_);
Expand description
Type for an array whose length is not predefined but bounded by a constant
The generic variable T
specifies the types of the elements of this array.
The const generic N
specifies the maxmimum number of elements a value of this
type is allowed to have.
Implementations
sourceimpl<T, const N: i32> LimitedVarArray<T, N>
impl<T, const N: i32> LimitedVarArray<T, N>
sourcepub fn new(vec: Vec<T>) -> Result<Self, StellarSdkError>
pub fn new(vec: Vec<T>) -> Result<Self, StellarSdkError>
Construct a new LimitedVarArray
from a vector
The length of the vector must not exceed N
. Otherwise this function returns
an error
pub fn new_empty() -> Self
sourcepub fn get_vec(&self) -> &Vec<T>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn get_vec(&self) -> &Vec<T>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Returns a reference to the byte vector
pub fn len(&self) -> usize
sourcepub fn push(&mut self, item: T) -> Result<(), StellarSdkError>
pub fn push(&mut self, item: T) -> Result<(), StellarSdkError>
Add an element to the byte vector
Return an Err
if the array already has the maximal number of elements.
Trait Implementations
sourceimpl<T: Clone, const N: i32> Clone for LimitedVarArray<T, N>
impl<T: Clone, const N: i32> Clone for LimitedVarArray<T, N>
sourcefn clone(&self) -> LimitedVarArray<T, N>
fn clone(&self) -> LimitedVarArray<T, N>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: Debug, const N: i32> Debug for LimitedVarArray<T, N>
impl<T: Debug, const N: i32> Debug for LimitedVarArray<T, N>
sourceimpl<T: PartialEq, const N: i32> PartialEq<LimitedVarArray<T, N>> for LimitedVarArray<T, N>
impl<T: PartialEq, const N: i32> PartialEq<LimitedVarArray<T, N>> for LimitedVarArray<T, N>
sourcefn eq(&self, other: &LimitedVarArray<T, N>) -> bool
fn eq(&self, other: &LimitedVarArray<T, N>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &LimitedVarArray<T, N>) -> bool
fn ne(&self, other: &LimitedVarArray<T, N>) -> bool
This method tests for !=
.
sourceimpl<T: XdrCodec, const N: i32> XdrCodec for LimitedVarArray<T, N>
impl<T: XdrCodec, const N: i32> XdrCodec for LimitedVarArray<T, N>
sourcefn to_xdr_buffered(&self, write_stream: &mut WriteStream)
fn to_xdr_buffered(&self, write_stream: &mut WriteStream)
The XDR encoder implementation for LimitedVarArray
sourcefn from_xdr_buffered<R: AsRef<[u8]>>(
read_stream: &mut ReadStream<R>
) -> Result<Self, DecodeError>
fn from_xdr_buffered<R: AsRef<[u8]>>(
read_stream: &mut ReadStream<R>
) -> Result<Self, DecodeError>
The XDR decoder implementation for LimitedVarArray
sourcefn to_xdr(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
fn to_xdr(&self) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Encode this type as XDR Read more
sourcefn from_xdr<T: AsRef<[u8]>>(input: T) -> Result<Self, DecodeError>
fn from_xdr<T: AsRef<[u8]>>(input: T) -> Result<Self, DecodeError>
Decode XDR provided as a reference to a byte vector Read more
impl<T: Eq, const N: i32> Eq for LimitedVarArray<T, N>
impl<T, const N: i32> StructuralEq for LimitedVarArray<T, N>
impl<T, const N: i32> StructuralPartialEq for LimitedVarArray<T, N>
Auto Trait Implementations
impl<T, const N: i32> RefUnwindSafe for LimitedVarArray<T, N> where
T: RefUnwindSafe,
impl<T, const N: i32> Send for LimitedVarArray<T, N> where
T: Send,
impl<T, const N: i32> Sync for LimitedVarArray<T, N> where
T: Sync,
impl<T, const N: i32> Unpin for LimitedVarArray<T, N> where
T: Unpin,
impl<T, const N: i32> UnwindSafe for LimitedVarArray<T, N> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
impl<T> Downcast for T where
T: Any,
impl<T> Downcast for T where
T: Any,
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
Convert Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read more
fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert &Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read more
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert &mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more