Struct fil_actor_init::State
source · [−]Expand description
State is reponsible for creating
Fields
address_map: Cidnext_id: ActorIDnetwork_name: StringImplementations
sourceimpl State
impl State
pub fn new<BS: Blockstore>(store: &BS, network_name: String) -> Result<Self>
sourcepub fn map_address_to_new_id<BS: Blockstore>(
&mut self,
store: &BS,
addr: &Address
) -> Result<ActorID, HamtError>
pub fn map_address_to_new_id<BS: Blockstore>(
&mut self,
store: &BS,
addr: &Address
) -> Result<ActorID, HamtError>
Allocates a new ID address and stores a mapping of the argument address to it. Returns the newly-allocated address.
sourcepub fn resolve_address<BS: Blockstore>(
&self,
store: &BS,
addr: &Address
) -> Result<Option<Address>>
pub fn resolve_address<BS: Blockstore>(
&self,
store: &BS,
addr: &Address
) -> Result<Option<Address>>
ResolveAddress resolves an address to an ID-address, if possible. If the provided address is an ID address, it is returned as-is. This means that mapped ID-addresses (which should only appear as values, not keys) and singleton actor addresses (which are not in the map) pass through unchanged.
Returns an ID-address and true if the address was already an ID-address or was resolved
in the mapping.
Returns an undefined address and false if the address was not an ID-address and not found
in the mapping.
Returns an error only if state was inconsistent.
Trait Implementations
sourceimpl Cbor for State
impl Cbor for State
sourceimpl<'de> Deserialize<'de> for State
impl<'de> Deserialize<'de> for State
sourcefn 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
Auto Trait Implementations
impl RefUnwindSafe for State
impl Send for State
impl Sync for State
impl Unpin for State
impl UnwindSafe for State
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