pub enum ObjectBytes<'js> {
Show 14 variants
U8Array(TypedArray<'js, u8>),
I8Array(TypedArray<'js, i8>),
U16Array(TypedArray<'js, u16>),
I16Array(TypedArray<'js, i16>),
U32Array(TypedArray<'js, u32>),
I32Array(TypedArray<'js, i32>),
U64Array(TypedArray<'js, u64>),
I64Array(TypedArray<'js, i64>),
F16Array(TypedArray<'js, f16>),
F32Array(TypedArray<'js, f32>),
F64Array(TypedArray<'js, f64>),
U8ClampedArray(TypedArray<'js, U8Clamped>),
DataView(ArrayBuffer<'js>, usize, usize),
Vec(Vec<u8>),
}Variants§
U8Array(TypedArray<'js, u8>)
I8Array(TypedArray<'js, i8>)
U16Array(TypedArray<'js, u16>)
I16Array(TypedArray<'js, i16>)
U32Array(TypedArray<'js, u32>)
I32Array(TypedArray<'js, i32>)
U64Array(TypedArray<'js, u64>)
I64Array(TypedArray<'js, i64>)
F16Array(TypedArray<'js, f16>)
F32Array(TypedArray<'js, f32>)
F64Array(TypedArray<'js, f64>)
U8ClampedArray(TypedArray<'js, U8Clamped>)
DataView(ArrayBuffer<'js>, usize, usize)
Vec(Vec<u8>)
Implementations§
Source§impl<'js> ObjectBytes<'js>
impl<'js> ObjectBytes<'js>
pub fn from(ctx: &Ctx<'js>, value: &Value<'js>) -> Result<Self>
pub fn from_offset( ctx: &Ctx<'js>, value: &Value<'js>, offset: usize, length: Option<usize>, ) -> Result<Self>
pub fn as_bytes(&self, ctx: &Ctx<'js>) -> Result<&[u8]>
Sourcepub fn as_bytes_opt(&self) -> Option<&[u8]>
pub fn as_bytes_opt(&self) -> Option<&[u8]>
Returns the underlying bytes, or None if the buffer is detached or
the DataView range is invalid (including arithmetic overflow). Unlike
[as_bytes], does not raise a JS exception.
pub fn into_bytes(self, ctx: &Ctx<'_>) -> Result<Vec<u8>>
pub fn from_array_buffer(obj: &Object<'js>) -> Result<Option<ObjectBytes<'js>>>
pub fn get_array_buffer( &self, ) -> Result<Option<(ArrayBuffer<'js>, usize, usize)>>
Trait Implementations§
Source§impl<'js> Clone for ObjectBytes<'js>
impl<'js> Clone for ObjectBytes<'js>
Source§fn clone(&self) -> ObjectBytes<'js>
fn clone(&self) -> ObjectBytes<'js>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'js> FromJs<'js> for ObjectBytes<'js>
impl<'js> FromJs<'js> for ObjectBytes<'js>
Source§impl<'js> IntoJs<'js> for ObjectBytes<'js>
impl<'js> IntoJs<'js> for ObjectBytes<'js>
Source§impl<'js> JsLifetime<'js> for ObjectBytes<'js>
impl<'js> JsLifetime<'js> for ObjectBytes<'js>
Source§type Changed<'to> = ObjectBytes<'to>
type Changed<'to> = ObjectBytes<'to>
The target which has the same type as a
Self but with another lifetime 'tSource§impl<'js> PartialEq for ObjectBytes<'js>
impl<'js> PartialEq for ObjectBytes<'js>
impl<'js> StructuralPartialEq for ObjectBytes<'js>
Source§impl<'a, 'js> TryFrom<&'a ObjectBytes<'js>> for &'a [u8]
impl<'a, 'js> TryFrom<&'a ObjectBytes<'js>> for &'a [u8]
Auto Trait Implementations§
impl<'js> !Send for ObjectBytes<'js>
impl<'js> !Sync for ObjectBytes<'js>
impl<'js> !UnwindSafe for ObjectBytes<'js>
impl<'js> Freeze for ObjectBytes<'js>
impl<'js> RefUnwindSafe for ObjectBytes<'js>
impl<'js> Unpin for ObjectBytes<'js>
impl<'js> UnsafeUnpin for ObjectBytes<'js>
Blanket Implementations§
Source§impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
impl<'js, T> AsProperty<'js, T> for Twhere
T: IntoJs<'js>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
impl<'js, T> FromParam<'js> for Twhere
T: FromJs<'js>,
Source§fn param_requirement() -> ParamRequirement
fn param_requirement() -> ParamRequirement
The parameters requirements this value requires.
Source§fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
fn from_param<'a>(params: &mut ParamsAccessor<'a, 'js>) -> Result<T, Error>
Convert from a parameter value.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more