pub struct DurableStreamWriter { /* private fields */ }Expand description
A non-pipelining producer. A cancelled or failed append remains pending;
call retry_pending to resolve that exact payload before supplying new data.
Dropping this writer does not undo an external write.
Implementations§
Source§impl DurableStreamWriter
impl DurableStreamWriter
pub fn new( url: impl Into<String>, content_type: impl Into<String>, options: WriteOptions, ) -> Result<Self, Error>
pub fn producer(&self) -> &Producer
pub fn has_pending(&self) -> bool
Sourcepub async fn append_json<T: Serialize>(
&mut self,
values: &[T],
close: bool,
) -> Result<AppendReceipt, Error>
pub async fn append_json<T: Serialize>( &mut self, values: &[T], close: bool, ) -> Result<AppendReceipt, Error>
Each element is encoded separately; an array-valued element stays one message.
pub async fn append_bytes( &mut self, bytes: &[u8], close: bool, ) -> Result<AppendReceipt, Error>
Sourcepub async fn close(&mut self) -> Result<AppendReceipt, Error>
pub async fn close(&mut self) -> Result<AppendReceipt, Error>
Close-only consumes a sequence just like an append-and-close.
pub async fn retry_pending(&mut self) -> Result<AppendReceipt, Error>
Auto Trait Implementations§
impl !Freeze for DurableStreamWriter
impl RefUnwindSafe for DurableStreamWriter
impl Send for DurableStreamWriter
impl Sync for DurableStreamWriter
impl Unpin for DurableStreamWriter
impl UnsafeUnpin for DurableStreamWriter
impl UnwindSafe for DurableStreamWriter
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