[−][src]Struct ontio_std::abi::EventBuilder
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]
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]
pub fn bool(self, b: bool) -> Self[src]
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]
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,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
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.
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>,