pub struct Blob<'js> { /* private fields */ }Implementations§
Source§impl<'js> Blob<'js>
impl<'js> Blob<'js>
pub const js_text: __impl_text = __impl_text
pub const js_array_buffer: __impl_array_buffer = __impl_array_buffer
pub const js_bytes: __impl_bytes = __impl_bytes
pub const js_slice: __impl_slice = __impl_slice
pub const js_stream: __impl_stream = __impl_stream
pub const js_has_instance: __impl_has_instance = __impl_has_instance
Source§impl<'js> Blob<'js>
impl<'js> Blob<'js>
pub async fn text(&self) -> String
pub async fn array_buffer(&self, ctx: Ctx<'js>) -> Result<ArrayBuffer<'js>>
pub async fn bytes(&self, ctx: Ctx<'js>) -> Result<Value<'js>>
pub fn slice( &self, ctx: Ctx<'js>, start: Opt<Value<'js>>, end: Opt<Value<'js>>, content_type: Opt<Value<'js>>, ) -> Result<Blob<'js>>
pub fn stream(&self, ctx: Ctx<'js>) -> Result<Value<'js>>
pub fn has_instance(value: Value<'js>) -> bool
pub fn slice_blob( &self, ctx: &Ctx<'js>, start: Option<isize>, end: Option<isize>, content_type: Option<Value<'js>>, ) -> Result<Blob<'js>>
pub fn mime_type(&self) -> String
pub fn size(&self) -> usize
pub fn to_string_tag() -> &'static str
pub fn new( ctx: Ctx<'js>, this: This<Value<'js>>, parts: Opt<Value<'js>>, options: Opt<Value<'js>>, ) -> Result<Self>
Source§impl<'js> Blob<'js>
impl<'js> Blob<'js>
pub fn from_bytes( ctx: &Ctx<'js>, data: Vec<u8>, content_type: Option<String>, ) -> Result<Self>
pub fn from_parts( ctx: Ctx<'js>, parts: Opt<Value<'js>>, options: Opt<Value<'js>>, ) -> Result<Self>
pub fn get_bytes(&self) -> Vec<u8> ⓘ
Sourcepub fn array_buffer_ref(&self) -> ArrayBuffer<'js>
pub fn array_buffer_ref(&self) -> ArrayBuffer<'js>
Zero-copy access to the underlying ArrayBuffer. Cloning the handle is
cheap (it’s a JS-refcount bump); no bytes are copied. Useful for
consumers that want to pass the Blob body on to hyper via
ObjectBytes::DataView without the get_bytes() allocation.
Trait Implementations§
Source§impl<'js> ConstructorCreator<'js, Blob<'js>> for ConstructorCreate<Blob<'js>>
impl<'js> ConstructorCreator<'js, Blob<'js>> for ConstructorCreate<Blob<'js>>
fn create_constructor(&self, ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Source§impl<'js> JsClass<'js> for Blob<'js>
impl<'js> JsClass<'js> for Blob<'js>
Source§fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
fn constructor(ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Returns a predefined constructor for this specific class type if there is one.
Source§fn call<'a>(
this: &JsCell<'js, Self>,
params: Params<'a, 'js>,
) -> Result<Value<'js>, Error>
fn call<'a>( this: &JsCell<'js, Self>, params: Params<'a, 'js>, ) -> Result<Value<'js>, Error>
The function which will be called if
Self::KIND is ClassKind::Callable and an object with this
class is called as if it is a function.Source§fn exotic_get_property(
this: &JsCell<'js, Self>,
ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
) -> Result<Value<'js>, Error>
fn exotic_get_property( this: &JsCell<'js, Self>, ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, ) -> Result<Value<'js>, Error>
The function which will be called if a get property is performed on an object with this class
Source§fn exotic_set_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
_receiver: Value<'js>,
_value: Value<'js>,
) -> Result<bool, Error>
fn exotic_set_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, _receiver: Value<'js>, _value: Value<'js>, ) -> Result<bool, Error>
The function which will be called if a set property is performed on an object with this class
Source§fn exotic_delete_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_delete_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if a delete property is performed on an object with this class
Source§fn exotic_has_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<bool, Error>
fn exotic_has_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<bool, Error>
The function which will be called if has property or similar is called on an object with this class
Source§fn exotic_get_own_property(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
_atom: Atom<'js>,
) -> Result<Option<PropertyDescriptor<'js>>, Error>
fn exotic_get_own_property( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, _atom: Atom<'js>, ) -> Result<Option<PropertyDescriptor<'js>>, Error>
Called to get the own property descriptor for a given property name. Read more
Source§fn exotic_get_own_property_names(
this: &JsCell<'js, Self>,
_ctx: &Ctx<'js>,
) -> Result<Vec<PropertyName<'js>>, Error>
fn exotic_get_own_property_names( this: &JsCell<'js, Self>, _ctx: &Ctx<'js>, ) -> Result<Vec<PropertyName<'js>>, Error>
Called to enumerate the own property names of this object. Read more
Source§impl<'js> JsLifetime<'js> for Blob<'js>
impl<'js> JsLifetime<'js> for Blob<'js>
Auto Trait Implementations§
impl<'js> !Send for Blob<'js>
impl<'js> !Sync for Blob<'js>
impl<'js> !UnwindSafe for Blob<'js>
impl<'js> Freeze for Blob<'js>
impl<'js> RefUnwindSafe for Blob<'js>
impl<'js> Unpin for Blob<'js>
impl<'js> UnsafeUnpin for Blob<'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