Struct scrypto::prelude::IndexedScryptoValue
source · pub struct IndexedScryptoValue {
bytes: Vec<u8, Global>,
references: Vec<NodeId, Global>,
owned_nodes: Vec<NodeId, Global>,
scrypto_value: RefCell<Option<Value<ScryptoCustomValueKind, ScryptoCustomValue>>>,
}
Fields§
§bytes: Vec<u8, Global>
§references: Vec<NodeId, Global>
§owned_nodes: Vec<NodeId, Global>
§scrypto_value: RefCell<Option<Value<ScryptoCustomValueKind, ScryptoCustomValue>>>
Implementations§
source§impl IndexedScryptoValue
impl IndexedScryptoValue
pub fn unit() -> IndexedScryptoValue
pub fn from_typed<T>(value: &T) -> IndexedScryptoValuewhere T: ScryptoEncode + ?Sized,
pub fn from_scrypto_value( value: Value<ScryptoCustomValueKind, ScryptoCustomValue> ) -> IndexedScryptoValue
pub fn from_slice(slice: &[u8]) -> Result<IndexedScryptoValue, DecodeError>
pub fn from_vec( vec: Vec<u8, Global> ) -> Result<IndexedScryptoValue, DecodeError>
pub fn to_scrypto_value( &self ) -> Value<ScryptoCustomValueKind, ScryptoCustomValue>
pub fn as_scrypto_value( &self ) -> Ref<'_, Value<ScryptoCustomValueKind, ScryptoCustomValue>>
pub fn as_typed<T>(&self) -> Result<T, DecodeError>where T: ScryptoDecode,
pub fn as_slice(&self) -> &[u8] ⓘ
pub fn as_vec_ref(&self) -> &Vec<u8, Global> ⓘ
pub fn len(&self) -> usize
pub fn references(&self) -> &Vec<NodeId, Global>
pub fn owned_nodes(&self) -> &Vec<NodeId, Global>
pub fn unpack( self ) -> (Vec<u8, Global>, Vec<NodeId, Global>, Vec<NodeId, Global>)
Trait Implementations§
source§impl Clone for IndexedScryptoValue
impl Clone for IndexedScryptoValue
source§fn clone(&self) -> IndexedScryptoValue
fn clone(&self) -> IndexedScryptoValue
Returns a copy 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 moresource§impl<'s, 'a> ContextualDisplay<ValueDisplayParameters<'s, 'a, ScryptoCustomExtension>> for IndexedScryptoValue
impl<'s, 'a> ContextualDisplay<ValueDisplayParameters<'s, 'a, ScryptoCustomExtension>> for IndexedScryptoValue
type Error = FormattingError
source§fn contextual_format<F>(
&self,
f: &mut F,
context: &ValueDisplayParameters<'_, '_, ScryptoCustomExtension>
) -> Result<(), <IndexedScryptoValue as ContextualDisplay<ValueDisplayParameters<'s, 'a, ScryptoCustomExtension>>>::Error>where
F: Write,
fn contextual_format<F>( &self, f: &mut F, context: &ValueDisplayParameters<'_, '_, ScryptoCustomExtension> ) -> Result<(), <IndexedScryptoValue as ContextualDisplay<ValueDisplayParameters<'s, 'a, ScryptoCustomExtension>>>::Error>where F: Write,
Formats the value to the given
fmt::Write
buffer, making use of the provided context.
See also format
, which is typically easier to use, as it takes an Into<Context>
instead of a &Context
.§fn format<F, TContext>(
&self,
f: &mut F,
context: TContext
) -> Result<(), Self::Error>where
F: Write,
TContext: Into<Context>,
fn format<F, TContext>( &self, f: &mut F, context: TContext ) -> Result<(), Self::Error>where F: Write, TContext: Into<Context>,
Formats the value to the given
fmt::Write
buffer, making use of the provided context.
See also contextual_format
, which takes a &Context
instead of an Into<Context>
. Read more§fn display<TContext, 'a, 'b>(
&'a self,
context: TContext
) -> ContextDisplayable<'a, Self, Context>where
TContext: Into<Context>,
fn display<TContext, 'a, 'b>( &'a self, context: TContext ) -> ContextDisplayable<'a, Self, Context>where TContext: Into<Context>,
fn to_string<TContext, 'a, 'b>(&'a self, context: TContext) -> Stringwhere TContext: Into<Context>,
source§impl Debug for IndexedScryptoValue
impl Debug for IndexedScryptoValue
source§impl PartialEq<IndexedScryptoValue> for IndexedScryptoValue
impl PartialEq<IndexedScryptoValue> for IndexedScryptoValue
source§fn eq(&self, other: &IndexedScryptoValue) -> bool
fn eq(&self, other: &IndexedScryptoValue) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for IndexedScryptoValue
impl StructuralEq for IndexedScryptoValue
impl StructuralPartialEq for IndexedScryptoValue
Auto Trait Implementations§
impl !RefUnwindSafe for IndexedScryptoValue
impl Send for IndexedScryptoValue
impl !Sync for IndexedScryptoValue
impl Unpin for IndexedScryptoValue
impl UnwindSafe for IndexedScryptoValue
Blanket Implementations§
§impl<U> As for U
impl<U> As for U
§fn as_<T>(self) -> Twhere
T: CastFrom<U>,
fn as_<T>(self) -> Twhere T: CastFrom<U>,
Casts
self
to type T
. The semantics of numeric casting with the as
operator are followed, so <T as As>::as_::<U>
can be used in the same way as T as U
for numeric conversions. Read moresource§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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more