Struct vertigo::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 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_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 plain_response(&self, body: String)

Synthetic command to respond with plain text, not DOM

Trait Implementations§

source§

impl Clone for ApiImport

source§

fn clone(&self) -> ApiImport

Returns a copy 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> 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,

§

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>,

§

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>,

§

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.