pub struct Heap { /* private fields */ }
Implementations§
Source§impl Heap
impl Heap
pub fn new() -> Heap
pub fn is_empty(&self) -> bool
pub fn remove_partition<E, F>( &mut self, node_id: &NodeId, partition_number: PartitionNumber, on_io_access: &mut F, ) -> Result<BTreeMap<SubstateKey, IndexedScryptoValue>, CallbackError<HeapRemovePartitionError, E>>
Sourcepub fn get_substate(
&self,
node_id: &NodeId,
partition_num: PartitionNumber,
substate_key: &SubstateKey,
) -> Option<&IndexedScryptoValue>
pub fn get_substate( &self, node_id: &NodeId, partition_num: PartitionNumber, substate_key: &SubstateKey, ) -> Option<&IndexedScryptoValue>
Reads a substate
Sourcepub fn set_substate<E, F>(
&mut self,
node_id: NodeId,
partition_number: PartitionNumber,
substate_key: SubstateKey,
substate_value: IndexedScryptoValue,
on_io_access: &mut F,
) -> Result<(), E>
pub fn set_substate<E, F>( &mut self, node_id: NodeId, partition_number: PartitionNumber, substate_key: SubstateKey, substate_value: IndexedScryptoValue, on_io_access: &mut F, ) -> Result<(), E>
Inserts or overwrites a substate
pub fn remove_substate<E, F>( &mut self, node_id: &NodeId, partition_number: PartitionNumber, substate_key: &SubstateKey, on_io_access: &mut F, ) -> Result<Option<IndexedScryptoValue>, E>
Sourcepub fn scan_keys(
&self,
node_id: &NodeId,
partition_num: PartitionNumber,
count: u32,
) -> Vec<SubstateKey>
pub fn scan_keys( &self, node_id: &NodeId, partition_num: PartitionNumber, count: u32, ) -> Vec<SubstateKey>
Scans the keys of a node’s partition. On an non-existing node/partition, this will return an empty vector
Sourcepub fn drain_substates<E, F>(
&mut self,
node_id: &NodeId,
partition_number: PartitionNumber,
count: u32,
on_io_access: &mut F,
) -> Result<Vec<(SubstateKey, IndexedScryptoValue)>, E>
pub fn drain_substates<E, F>( &mut self, node_id: &NodeId, partition_number: PartitionNumber, count: u32, on_io_access: &mut F, ) -> Result<Vec<(SubstateKey, IndexedScryptoValue)>, E>
Drains the substates from a node’s partition. On an non-existing node/partition, this will return an empty vector
Sourcepub fn create_node<E, F>(
&mut self,
node_id: NodeId,
substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>,
on_io_access: &mut F,
) -> Result<(), E>
pub fn create_node<E, F>( &mut self, node_id: NodeId, substates: BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>, on_io_access: &mut F, ) -> Result<(), E>
Inserts a new node to heap.
Sourcepub fn remove_node<E, F>(
&mut self,
node_id: &NodeId,
on_io_access: &mut F,
) -> Result<BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>, CallbackError<HeapRemoveNodeError, E>>
pub fn remove_node<E, F>( &mut self, node_id: &NodeId, on_io_access: &mut F, ) -> Result<BTreeMap<PartitionNumber, BTreeMap<SubstateKey, IndexedScryptoValue>>, CallbackError<HeapRemoveNodeError, E>>
Removes node.
Auto Trait Implementations§
impl Freeze for Heap
impl !RefUnwindSafe for Heap
impl Send for Heap
impl !Sync for Heap
impl Unpin for Heap
impl !UnwindSafe for Heap
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, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
impl<T, U> ContextualTryInto<U> for Twhere
U: ContextualTryFrom<T>,
type Error = <U as ContextualTryFrom<T>>::Error
type Context = <U as ContextualTryFrom<T>>::Context
fn contextual_try_into( self, context: &<U as ContextualTryFrom<T>>::Context, ) -> Result<U, <U as ContextualTryFrom<T>>::Error>
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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
.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.Source§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.Source§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.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