pub struct Source<'a, T> { /* private fields */ }Available on crate features 
runtime and component-model and component-model-async only.Expand description
Represents the buffer for a host- or guest-initiated stream write.
Implementations§
Source§impl<'a, T> Source<'a, T>
 
impl<'a, T> Source<'a, T>
Sourcepub fn read<B, S: AsContextMut>(
    &mut self,
    store: S,
    buffer: &mut B,
) -> Result<()>where
    T: Lift + 'static,
    B: ReadBuffer<T>,
 
pub fn read<B, S: AsContextMut>(
    &mut self,
    store: S,
    buffer: &mut B,
) -> Result<()>where
    T: Lift + 'static,
    B: ReadBuffer<T>,
Accept zero or more items from the writer.
Sourcepub fn remaining(&self, store: impl AsContextMut) -> usizewhere
    T: 'static,
 
pub fn remaining(&self, store: impl AsContextMut) -> usizewhere
    T: 'static,
Return the number of items remaining to be read from the current write operation.
Source§impl<'a> Source<'a, u8>
 
impl<'a> Source<'a, u8>
Sourcepub fn as_direct<D>(self, store: StoreContextMut<'a, D>) -> DirectSource<'a, D>
 
pub fn as_direct<D>(self, store: StoreContextMut<'a, D>) -> DirectSource<'a, D>
Return a DirectSource view of self.
Auto Trait Implementations§
impl<'a, T> Freeze for Source<'a, T>
impl<'a, T> !RefUnwindSafe for Source<'a, T>
impl<'a, T> Send for Source<'a, T>
impl<'a, T> Sync for Source<'a, T>
impl<'a, T> Unpin for Source<'a, T>
impl<'a, T> !UnwindSafe for Source<'a, T>
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> 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