[][src]Struct ontio_std::abi::EventBuilder

#[must_use = "this `EventBuilder` should call notify to take effect"]pub struct EventBuilder { /* fields omitted */ }

Entity used to push events in a contract.

Implementations

impl EventBuilder[src]

pub fn new() -> Self[src]

Create a new eventbuilder instance to push &str, bytearray, Address, U128, bool, H256 type data in the contract.

Example

  let mut eb = EventBuilder::new();

pub fn string(self, method: &str) -> Self[src]

Push &str type event in contract

Example

   EventBuilder::new().string("notify").notify();

pub fn bytearray(self, bytes: &[u8]) -> Self[src]

Push bytearray type event in contract

Example

   EventBuilder::new().bytearray("notify".as_bytes()).notify();

pub fn address(self, address: &Address) -> Self[src]

Push Address type event in contract

Example

   let addr = Address::repeat_byte(1u8);
   EventBuilder::new().address(&addr).notify();

pub fn number(self, amount: U128) -> Self[src]

Push U128 type event in contract

Example

   EventBuilder::new().number(123 as U128).notify();

pub fn bool(self, b: bool) -> Self[src]

Push bool type event in contract

Example

   EventBuilder::new().number(123 as U128).notify();

pub fn h256(self, hash: &H256) -> Self[src]

Push H256 type event in contract

Example

   let hash = runtime::sha256("test");
   EventBuilder::new().h256(&hash).notify();

pub fn notify(self)[src]

Trait Implementations

impl Default for EventBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.