pub struct Protocol { /* private fields */ }Expand description
A decoded protocol with reusable indices for repeated WASM renders.
Implementations§
Source§impl Protocol
impl Protocol
Sourcepub fn new(
protocol_bytes: &[u8],
plugin: Option<String>,
) -> Result<Protocol, JsValue>
pub fn new( protocol_bytes: &[u8], plugin: Option<String>, ) -> Result<Protocol, JsValue>
Decode protobuf bytes once for repeated rendering.
Sourcepub fn render(
&self,
state_json: &str,
options: Option<Object>,
) -> Result<String, JsValue>
pub fn render( &self, state_json: &str, options: Option<Object>, ) -> Result<String, JsValue>
Render from an existing JSON string.
Sourcepub fn render_stream(
&self,
state_json: &str,
on_chunk: &Function,
options: Option<Object>,
) -> Result<(), JsValue>
pub fn render_stream( &self, state_json: &str, on_chunk: &Function, options: Option<Object>, ) -> Result<(), JsValue>
Stream from an existing JSON string in bounded chunks.
Sourcepub fn render_partial(
&self,
state_json: &str,
entry_id: &str,
request_path: &str,
inventory_hex: &str,
) -> Result<String, JsValue>
pub fn render_partial( &self, state_json: &str, entry_id: &str, request_path: &str, inventory_hex: &str, ) -> Result<String, JsValue>
Produce a complete partial-navigation response.
Trait Implementations§
Source§impl FromWasmAbi for Protocol
impl FromWasmAbi for Protocol
Source§impl IntoWasmAbi for Protocol
impl IntoWasmAbi for Protocol
Source§impl LongRefFromWasmAbi for Protocol
impl LongRefFromWasmAbi for Protocol
Source§impl OptionFromWasmAbi for Protocol
impl OptionFromWasmAbi for Protocol
Source§impl OptionIntoWasmAbi for Protocol
impl OptionIntoWasmAbi for Protocol
Source§impl RefFromWasmAbi for Protocol
impl RefFromWasmAbi for Protocol
Source§type Abi = WasmPtr<WasmRefCell<Protocol>>
type Abi = WasmPtr<WasmRefCell<Protocol>>
The Wasm ABI type references to
Self are recovered from.Source§impl RefMutFromWasmAbi for Protocol
impl RefMutFromWasmAbi for Protocol
impl SupportsConstructor for Protocol
impl SupportsInstanceProperty for Protocol
impl SupportsStaticProperty for Protocol
Source§impl TryFromJsValue for Protocol
impl TryFromJsValue for Protocol
Source§impl VectorFromWasmAbi for Protocol
impl VectorFromWasmAbi for Protocol
Source§impl VectorIntoWasmAbi for Protocol
impl VectorIntoWasmAbi for Protocol
Auto Trait Implementations§
impl !Freeze for Protocol
impl RefUnwindSafe for Protocol
impl Send for Protocol
impl Sync for Protocol
impl Unpin for Protocol
impl UnsafeUnpin for Protocol
impl UnwindSafe for Protocol
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.