pub async fn init(
    context: Arc<ClientContext>,
    params: ParamsOfInit,
    callbacks: impl BrowserCallbacks + Send + Sync + 'static,
) -> ClientResult<RegisteredDebot> {
    let mut dengine =
        DEngine::new_with_client(params.address, None, context.clone(), Arc::new(callbacks));
    let info: DebotInfo = dengine.init().await.map_err(Error::fetch_failed)?.into();

    let handle = context.get_next_id();
    context.debots.insert(handle, Mutex::new(dengine));
    let debot_abi = info.dabi.clone().unwrap_or(String::new());
    Ok(RegisteredDebot { debot_handle: DebotHandle(handle), info, debot_abi })
}
/// [UNSTABLE](UNSTABLE.md) Creates an instance of DeBot.
///
/// Downloads DeBot smart contract (code and data) from blockchain and creates
/// an instance of Debot Engine for it.
/// Returns a debot handle which can be used later in `start`, `execute` or `send` functions.
/// # Remarks
/// It does not switch debot to context 0. Browser Callbacks are not called.
/// Can be used to invoke DeBot without starting.
[UNSTABLE](UNSTABLE.md) Creates an instance of DeBot.
Downloads DeBot smart contract (code and data) from blockchain and creates
an instance of Debot Engine for it.
[ UNSTABLE ] ( UNSTABLE . md ) Creates an instance of DeBot . Downloads DeBot smart contract ( code and data ) from blockchain and creates an instance of Debot Engine for it .
pub async fn init(
    context: Arc<ClientContext>,
    params: ParamsOfInit,
    callbacks: impl BrowserCallbacks + Send + Sync + 'static,
) -> ClientResult<RegisteredDebot> {
    let mut dengine =
        DEngine::new_with_client(params.address, None, context.clone(), Arc::new(callbacks));
    let info: DebotInfo = dengine.init().await.map_err(Error::fetch_failed)?.into();
    let handle = context.get_next_id();
    context.debots.insert(handle, Mutex::new(dengine));
    let debot_abi = info.dabi.clone().unwrap_or(String::new());
    Ok(RegisteredDebot { debot_handle: DebotHandle(handle), info, debot_abi })
}
pub async fn init ( context : Arc < ClientContext > , params : ParamsOfInit , callbacks : impl BrowserCallbacks + Send + Sync + ' static , ) -> ClientResult < RegisteredDebot > { let mut dengine = DEngine :: new_with_client ( params . address , None , context . clone ( ) , Arc :: new ( callbacks ) ) ; let info : DebotInfo = dengine . init ( ) . await . map_err ( Error :: fetch_failed ) ? . into ( ) ; let handle = context . get_next_id ( ) ; context . debots . insert ( handle , Mutex :: new ( dengine ) ) ; let debot_abi = info . dabi . clone ( ) . unwrap_or ( String :: new ( ) ) ; Ok ( RegisteredDebot { debot_handle : DebotHandle ( handle ) , info , debot_abi } ) }
[UNSTABLE](UNSTABLE.md) Creates an instance of DeBot.
[ UNSTABLE ] ( UNSTABLE . md ) Creates an instance of DeBot .
context
Arc<ClientContext>
params
ParamsOfInit
callbacks
impl BrowserCallbacks + Send + Sync + 'static
remarks
It does not switch debot to context 0. Browser Callbacks are not called.
Can be used to invoke DeBot without starting.
It does not switch debot to context 0 . Browser Callbacks are not called . Can be used to invoke DeBot without starting .