pub struct ReadableStream<'js> {
pub controller: ReadableStreamControllerClass<'js>,
pub disturbed: bool,
pub state: ReadableStreamState<'js>,
/* private fields */
}Fields§
§controller: ReadableStreamControllerClass<'js>§disturbed: bool§state: ReadableStreamState<'js>Implementations§
Source§impl<'js> ReadableStream<'js>
impl<'js> ReadableStream<'js>
pub fn is_readable_stream_locked(&self) -> bool
Sourcepub fn from_pull_algorithm(
ctx: Ctx<'js>,
pull_algorithm: PullAlgorithm<'js>,
cancel_algorithm: CancelAlgorithm<'js>,
) -> Result<Class<'js, Self>>
pub fn from_pull_algorithm( ctx: Ctx<'js>, pull_algorithm: PullAlgorithm<'js>, cancel_algorithm: CancelAlgorithm<'js>, ) -> Result<Class<'js, Self>>
Create a ReadableStream from Rust pull/cancel algorithms
Sourcepub fn from_pull_algorithm_with_options(
ctx: Ctx<'js>,
pull_algorithm: PullAlgorithm<'js>,
cancel_algorithm: CancelAlgorithm<'js>,
high_water_mark: Option<f64>,
) -> Result<Class<'js, Self>>
pub fn from_pull_algorithm_with_options( ctx: Ctx<'js>, pull_algorithm: PullAlgorithm<'js>, cancel_algorithm: CancelAlgorithm<'js>, high_water_mark: Option<f64>, ) -> Result<Class<'js, Self>>
Create a ReadableStream from Rust pull/cancel algorithms with custom highWaterMark
Sourcepub fn from_byte_pull_algorithm(
ctx: Ctx<'js>,
pull_algorithm: PullAlgorithm<'js>,
cancel_algorithm: CancelAlgorithm<'js>,
) -> Result<Class<'js, Self>>
pub fn from_byte_pull_algorithm( ctx: Ctx<'js>, pull_algorithm: PullAlgorithm<'js>, cancel_algorithm: CancelAlgorithm<'js>, ) -> Result<Class<'js, Self>>
Create a byte-source ReadableStream (i.e. type: "bytes") from Rust
pull/cancel algorithms. BYOB readers can attach to the returned
stream, and the pull algorithm receives a byte controller so it can
enqueue Uint8Array chunks that stream directly into BYOB reads
without copying.
pub fn create_readable_byte_stream( ctx: Ctx<'js>, start_algorithm: StartAlgorithm<'js>, pull_algorithm: PullAlgorithm<'js>, cancel_algorithm: CancelAlgorithm<'js>, ) -> Result<(Class<'js, Self>, ReadableByteStreamControllerClass<'js>)>
Trait Implementations§
Source§impl<'js> ConstructorCreator<'js, ReadableStream<'js>> for ConstructorCreate<ReadableStream<'js>>
impl<'js> ConstructorCreator<'js, ReadableStream<'js>> for ConstructorCreate<ReadableStream<'js>>
fn create_constructor(&self, ctx: &Ctx<'js>) -> Result<Option<Constructor<'js>>>
Source§impl<'js> FromJs<'js> for ReadableStream<'js>where
for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,
impl<'js> FromJs<'js> for ReadableStream<'js>where
for<'a> CloneWrapper<'a, Self>: CloneTrait<Self>,
Source§impl<'js> IntoJs<'js> for ReadableStream<'js>
impl<'js> IntoJs<'js> for ReadableStream<'js>
Source§impl<'js> JsClass<'js> for ReadableStream<'js>
impl<'js> JsClass<'js> for ReadableStream<'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 ReadableStream<'js>
impl<'js> JsLifetime<'js> for ReadableStream<'js>
Source§type Changed<'to> = ReadableStream<'to>
type Changed<'to> = ReadableStream<'to>
The target which has the same type as a
Self but with another lifetime 'tSource§impl<'js> MethodImplementor<ReadableStream<'js>> for MethodImpl<ReadableStream<'js>>
impl<'js> MethodImplementor<ReadableStream<'js>> for MethodImpl<ReadableStream<'js>>
Auto Trait Implementations§
impl<'js> !RefUnwindSafe for ReadableStream<'js>
impl<'js> !Send for ReadableStream<'js>
impl<'js> !Sync for ReadableStream<'js>
impl<'js> !UnwindSafe for ReadableStream<'js>
impl<'js> Freeze for ReadableStream<'js>
impl<'js> Unpin for ReadableStream<'js>
impl<'js> UnsafeUnpin for ReadableStream<'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> 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