pub struct BinaryResult { /* private fields */ }Expand description
Binary result buffer returned from execBinary()
Implementations§
Source§impl BinaryResult
impl BinaryResult
Sourcepub fn to_uint8_array(&self) -> Uint8Array
pub fn to_uint8_array(&self) -> Uint8Array
Get buffer as Uint8Array (copies data to JS) Use asView() for zero-copy access instead.
Sourcepub fn as_view(&self) -> Uint8Array
pub fn as_view(&self) -> Uint8Array
Get a zero-copy Uint8Array view into WASM memory. WARNING: This view becomes invalid if WASM memory grows or if this BinaryResult is freed. The caller must ensure the BinaryResult outlives any use of the returned view.
Source§impl BinaryResult
impl BinaryResult
Sourcepub fn new(buffer: Vec<u8>) -> BinaryResult
pub fn new(buffer: Vec<u8>) -> BinaryResult
Create a new BinaryResult from a buffer
Trait Implementations§
Source§impl From<BinaryResult> for JsValue
impl From<BinaryResult> for JsValue
Source§fn from(value: BinaryResult) -> JsValue
fn from(value: BinaryResult) -> JsValue
Converts to this type from the input type.
Source§impl FromWasmAbi for BinaryResult
impl FromWasmAbi for BinaryResult
Source§impl IntoWasmAbi for BinaryResult
impl IntoWasmAbi for BinaryResult
Source§impl LongRefFromWasmAbi for BinaryResult
impl LongRefFromWasmAbi for BinaryResult
Source§type Anchor = RcRef<BinaryResult>
type Anchor = RcRef<BinaryResult>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(
js: <BinaryResult as LongRefFromWasmAbi>::Abi,
) -> <BinaryResult as LongRefFromWasmAbi>::Anchor
unsafe fn long_ref_from_abi( js: <BinaryResult as LongRefFromWasmAbi>::Abi, ) -> <BinaryResult as LongRefFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl OptionFromWasmAbi for BinaryResult
impl OptionFromWasmAbi for BinaryResult
Source§fn is_none(abi: &<BinaryResult as FromWasmAbi>::Abi) -> bool
fn is_none(abi: &<BinaryResult as FromWasmAbi>::Abi) -> bool
Tests whether the argument is a “none” instance. If so it will be
deserialized as
None, and otherwise it will be passed to
FromWasmAbi.Source§impl OptionIntoWasmAbi for BinaryResult
impl OptionIntoWasmAbi for BinaryResult
Source§fn none() -> <BinaryResult as IntoWasmAbi>::Abi
fn none() -> <BinaryResult as IntoWasmAbi>::Abi
Returns an ABI instance indicating “none”, which JS will interpret as
the
None branch of this option. Read moreSource§impl RefFromWasmAbi for BinaryResult
impl RefFromWasmAbi for BinaryResult
Source§type Anchor = RcRef<BinaryResult>
type Anchor = RcRef<BinaryResult>
The type that holds the reference to
Self for the duration of the
invocation of the function that has an &Self parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§unsafe fn ref_from_abi(
js: <BinaryResult as RefFromWasmAbi>::Abi,
) -> <BinaryResult as RefFromWasmAbi>::Anchor
unsafe fn ref_from_abi( js: <BinaryResult as RefFromWasmAbi>::Abi, ) -> <BinaryResult as RefFromWasmAbi>::Anchor
Source§impl RefMutFromWasmAbi for BinaryResult
impl RefMutFromWasmAbi for BinaryResult
Source§type Anchor = RcRefMut<BinaryResult>
type Anchor = RcRefMut<BinaryResult>
Same as
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(
js: <BinaryResult as RefMutFromWasmAbi>::Abi,
) -> <BinaryResult as RefMutFromWasmAbi>::Anchor
unsafe fn ref_mut_from_abi( js: <BinaryResult as RefMutFromWasmAbi>::Abi, ) -> <BinaryResult as RefMutFromWasmAbi>::Anchor
Same as
RefFromWasmAbi::ref_from_abiSource§impl TryFromJsValue for BinaryResult
impl TryFromJsValue for BinaryResult
Source§fn try_from_js_value(value: JsValue) -> Result<BinaryResult, JsValue>
fn try_from_js_value(value: JsValue) -> Result<BinaryResult, JsValue>
Performs the conversion.
Source§fn try_from_js_value_ref(value: &JsValue) -> Option<BinaryResult>
fn try_from_js_value_ref(value: &JsValue) -> Option<BinaryResult>
Performs the conversion.
Source§impl VectorFromWasmAbi for BinaryResult
impl VectorFromWasmAbi for BinaryResult
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi( js: <BinaryResult as VectorFromWasmAbi>::Abi, ) -> Box<[BinaryResult]>
Source§impl VectorIntoWasmAbi for BinaryResult
impl VectorIntoWasmAbi for BinaryResult
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi( vector: Box<[BinaryResult]>, ) -> <BinaryResult as VectorIntoWasmAbi>::Abi
Auto Trait Implementations§
impl Freeze for BinaryResult
impl RefUnwindSafe for BinaryResult
impl Send for BinaryResult
impl Sync for BinaryResult
impl Unpin for BinaryResult
impl UnwindSafe for BinaryResult
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.