pub enum PullAlgorithm<'js> {
ReturnPromiseUndefined,
Function {
f: Function<'js>,
underlying_source: Null<Undefined<Object<'js>>>,
},
RustFunction(Rc<Box<dyn Fn(Ctx<'js>, ReadableStreamControllerClass<'js>) -> Result<Promise<'js>> + 'js>>),
Tee(Class<'js, TeeState<'js>>),
Transform(Class<'js, TransformStream<'js>>),
}Variants§
ReturnPromiseUndefined
Function
RustFunction(Rc<Box<dyn Fn(Ctx<'js>, ReadableStreamControllerClass<'js>) -> Result<Promise<'js>> + 'js>>)
Tee(Class<'js, TeeState<'js>>)
Transform(Class<'js, TransformStream<'js>>)
Implementations§
Source§impl<'js> PullAlgorithm<'js>
impl<'js> PullAlgorithm<'js>
pub fn from_fn( f: impl Fn(Ctx<'js>, ReadableStreamControllerClass<'js>) -> Result<Promise<'js>> + 'js, ) -> Self
Sourcepub fn from_fn_once(
f: impl FnOnce(Ctx<'js>, ReadableStreamControllerClass<'js>) -> Result<Promise<'js>> + 'js,
) -> Self
pub fn from_fn_once( f: impl FnOnce(Ctx<'js>, ReadableStreamControllerClass<'js>) -> Result<Promise<'js>> + 'js, ) -> Self
Wrap a one-shot pull closure. Subsequent invocations after the first
resolve with undefined without calling f again — useful for
streams that enqueue their whole payload in one go and then close.
Trait Implementations§
Source§impl<'js> Clone for PullAlgorithm<'js>
impl<'js> Clone for PullAlgorithm<'js>
Source§fn clone(&self) -> PullAlgorithm<'js>
fn clone(&self) -> PullAlgorithm<'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> JsLifetime<'js> for PullAlgorithm<'js>
impl<'js> JsLifetime<'js> for PullAlgorithm<'js>
Source§type Changed<'to> = PullAlgorithm<'to>
type Changed<'to> = PullAlgorithm<'to>
The target which has the same type as a
Self but with another lifetime 'tAuto Trait Implementations§
impl<'js> !RefUnwindSafe for PullAlgorithm<'js>
impl<'js> !Send for PullAlgorithm<'js>
impl<'js> !Sync for PullAlgorithm<'js>
impl<'js> !UnwindSafe for PullAlgorithm<'js>
impl<'js> Freeze for PullAlgorithm<'js>
impl<'js> Unpin for PullAlgorithm<'js>
impl<'js> UnsafeUnpin for PullAlgorithm<'js>
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
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<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