[−][src]Struct damn_vuln_blockchain::asset::AssetLedger
represents the world(full network) state of Asset
AssetLedger Messages:
- ChangeAssetOwner: Changes an asset's owner
- InitNetwork: Initializes assets to peers in the network
- GetAssetInfo: Get an asset's info
- DumpLedger: Dump the entire asset ledger
- ReplaceLedger: Replace the current ledger with another ledger, useful when
- ChooseValidator: Choose validator based on coinage
- GetPeerAssets: Get all the assets belonging to a peer
- SetLastTransation: Set last transaction in which the asset was used
- SetStake: Set stake for a block creation
- GetStake: Get stake for a block ID synchronising state
Fields
assets: Vec<Asset>
stake: Vec<Stake>
peer_id: String
Implementations
impl AssetLedger
[src]
pub fn new(peer_id: &str) -> Self
[src]
pub fn generate(peer_id: &str) -> AssetLedger
[src]
generates a bunch of fake assets
pub fn choose_validator(&self) -> Option<String>
[src]
chooses validator based on proof of stake
Trait Implementations
impl Actor for AssetLedger
[src]
type Context = Context<Self>
Actor execution context type
fn started(&mut self, ctx: &mut Self::Context)
fn stopping(&mut self, ctx: &mut Self::Context) -> Running
fn stopped(&mut self, ctx: &mut Self::Context)
fn start(self) -> Addr<Self> where
Self: Actor<Context = Context<Self>>,
Self: Actor<Context = Context<Self>>,
fn start_default() -> Addr<Self> where
Self: Actor<Context = Context<Self>> + Default,
Self: Actor<Context = Context<Self>> + Default,
fn start_in_arbiter<F>(arb: &Arbiter, f: F) -> Addr<Self> where
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
Self: Actor<Context = Context<Self>>,
fn create<F>(f: F) -> Addr<Self> where
F: FnOnce(&mut Context<Self>) -> Self,
Self: Actor<Context = Context<Self>>,
F: FnOnce(&mut Context<Self>) -> Self,
Self: Actor<Context = Context<Self>>,
impl Clone for AssetLedger
[src]
fn clone(&self) -> AssetLedger
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for AssetLedger
[src]
impl Default for AssetLedger
[src]
fn default() -> AssetLedger
[src]
impl<'de> Deserialize<'de> for AssetLedger
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Handler<ChangeAssetOwner> for AssetLedger
[src]
type Result = ()
The type of value that this handler will return. Read more
fn handle(
&mut self,
msg: ChangeAssetOwner,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: ChangeAssetOwner,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<ChooseValidator> for AssetLedger
[src]
type Result = MessageResult<ChooseValidator>
The type of value that this handler will return. Read more
fn handle(
&mut self,
_msg: ChooseValidator,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
_msg: ChooseValidator,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<DumpLedger> for AssetLedger
[src]
type Result = MessageResult<DumpLedger>
The type of value that this handler will return. Read more
fn handle(&mut self, _msg: DumpLedger, _ctx: &mut Self::Context) -> Self::Result
[src]
impl Handler<GetAssetInfo> for AssetLedger
[src]
type Result = MessageResult<GetAssetInfo>
The type of value that this handler will return. Read more
fn handle(
&mut self,
msg: GetAssetInfo,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: GetAssetInfo,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<GetPeerAssets> for AssetLedger
[src]
type Result = MessageResult<GetPeerAssets>
The type of value that this handler will return. Read more
fn handle(
&mut self,
msg: GetPeerAssets,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: GetPeerAssets,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<GetStake> for AssetLedger
[src]
type Result = MessageResult<GetStake>
The type of value that this handler will return. Read more
fn handle(&mut self, msg: GetStake, _ctx: &mut Self::Context) -> Self::Result
[src]
impl Handler<InitNetwork> for AssetLedger
[src]
type Result = MessageResult<InitNetwork>
The type of value that this handler will return. Read more
fn handle(&mut self, msg: InitNetwork, _ctx: &mut Self::Context) -> Self::Result
[src]
impl Handler<ReplaceLedger> for AssetLedger
[src]
type Result = ()
The type of value that this handler will return. Read more
fn handle(
&mut self,
msg: ReplaceLedger,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: ReplaceLedger,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<SetLastTransation> for AssetLedger
[src]
type Result = ()
The type of value that this handler will return. Read more
fn handle(
&mut self,
msg: SetLastTransation,
_ctx: &mut Self::Context
) -> Self::Result
[src]
&mut self,
msg: SetLastTransation,
_ctx: &mut Self::Context
) -> Self::Result
impl Handler<SetStake> for AssetLedger
[src]
type Result = ()
The type of value that this handler will return. Read more
fn handle(&mut self, msg: SetStake, _ctx: &mut Self::Context) -> Self::Result
[src]
impl Serialize for AssetLedger
[src]
Auto Trait Implementations
impl RefUnwindSafe for AssetLedger
impl Send for AssetLedger
impl Sync for AssetLedger
impl Unpin for AssetLedger
impl UnwindSafe for AssetLedger
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,