ApiImport

Struct ApiImport 

Source
pub struct ApiImport {
    pub panic_message: PanicMessage,
    pub fn_dom_access: fn(ptr: u32, size: u32) -> u32,
    pub on_fetch_start: EventEmitter<()>,
    pub on_fetch_stop: EventEmitter<()>,
    /* private fields */
}

Fields§

§panic_message: PanicMessage§fn_dom_access: fn(ptr: u32, size: u32) -> u32§on_fetch_start: EventEmitter<()>§on_fetch_stop: EventEmitter<()>

Implementations§

Source§

impl ApiImport

Source

pub fn show_panic_message(&self, message: String)

Source

pub fn console_debug_4(&self, arg1: &str, arg2: &str, arg3: &str, arg4: &str)

Source

pub fn console_log_4(&self, arg1: &str, arg2: &str, arg3: &str, arg4: &str)

Source

pub fn console_info_4(&self, arg1: &str, arg2: &str, arg3: &str, arg4: &str)

Source

pub fn console_warn_4(&self, arg1: &str, arg2: &str, arg3: &str, arg4: &str)

Source

pub fn console_error_4(&self, arg1: &str, arg2: &str, arg3: &str, arg4: &str)

Source

pub fn cookie_get(&self, cname: &str) -> String

Source

pub fn cookie_get_json(&self, cname: &str) -> JsJson

Source

pub fn cookie_set(&self, cname: &str, cvalue: &str, expires_in: u64)

Source

pub fn cookie_set_json(&self, cname: &str, cvalue: JsJson, expires_in: u64)

Source

pub fn interval_set<F: Fn() + 'static>( &self, duration: u32, callback: F, ) -> DropResource

Source

pub fn timeout_set<F: Fn() + 'static>( &self, duration: u32, callback: F, ) -> DropResource

Source

pub fn set_timeout_and_detach<F: Fn() + 'static>( &self, duration: u32, callback: F, )

Source

pub fn instant_now(&self) -> InstantType

Source

pub fn utc_now(&self) -> i64

Source

pub fn timezone_offset(&self) -> i32

Source

pub fn history_back(&self)

Source

pub fn get_hash_location(&self) -> String

Source

pub fn push_hash_location(&self, new_hash: &str)

Source

pub fn on_hash_change<F: Fn(String) + 'static>( &self, callback: F, ) -> DropResource

Source

pub fn get_history_location(&self) -> String

Source

pub fn push_history_location(&self, new_path: &str)

Source

pub fn replace_history_location(&self, new_hash: &str)

Source

pub fn on_history_change<F: Fn(String) + 'static>( &self, callback: F, ) -> DropResource

Source

pub fn fetch( &self, method: FetchMethod, url: String, headers: Option<HashMap<String, String>>, body: Option<RequestBody>, ) -> Pin<Box<dyn Future<Output = FetchResult> + 'static>>

Source

pub fn websocket<F: Fn(WebsocketMessage) + 'static>( &self, host: impl Into<String>, callback: F, ) -> DropResource

Source

pub fn websocket_send_message(&self, callback_id: u64, message: &str)

Source

pub fn dom_bulk_update(&self, value: JsJson)

Source

pub fn dom_access(&self) -> DomAccess

Source

pub fn get_random(&self, min: u32, max: u32) -> u32

Source

pub fn is_browser(&self) -> bool

Source

pub fn get_env(&self, name: String) -> Option<String>

Source

pub fn route_from_public(&self, path: impl Into<String>) -> String

Source

pub fn plain_response(&self, body: String)

Synthetic command to respond with plain text, not DOM

Source

pub fn set_status(&self, status: u16)

Synthetic command to respond with custom status code from SSR

Trait Implementations§

Source§

impl Clone for ApiImport

Source§

fn clone(&self) -> ApiImport

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ApiImport

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.