pub struct DataChannel {
pub id: u32,
pub closed: AtomicBool,
pub data_tx: Sender<Data>,
pub capacity: AtomicU32,
pub notify: Notify,
}Fields§
§id: u32§closed: AtomicBool§data_tx: Sender<Data>§capacity: AtomicU32§notify: NotifyImplementations§
Source§impl DataChannel
impl DataChannel
pub fn new_client(id: u32, data_tx: Sender<Data>) -> DataChannel
pub fn add_capacity(&self, amount: u32)
Sourcepub fn reset_capacity(&self, consumed: u32)
pub fn reset_capacity(&self, consumed: u32)
Resets capacity to full minus consumed, giving up on acks in flight - CLOUDPUB-1601.
Sourcepub async fn wait_for_capacity_or_reset(
&self,
required: u32,
reset_at: Option<Instant>,
) -> Result<(), SendError<()>>
pub async fn wait_for_capacity_or_reset( &self, required: u32, reset_at: Option<Instant>, ) -> Result<(), SendError<()>>
wait_for_capacity, but with reset_at the wait ends then with a capacity reset:
an agent before CLOUDPUB-1601 may never ack datagrams it lost.
pub async fn wait_for_capacity( &self, required: u32, ) -> Result<(), SendError<()>>
pub fn close(&self)
pub async fn closed(&self)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DataChannel
impl Forget for DataChannel
impl Move for DataChannel
impl RefUnwindSafe for DataChannel
impl Send for DataChannel
impl Sync for DataChannel
impl Unpin for DataChannel
impl UnsafeUnpin for DataChannel
impl UnwindSafe for DataChannel
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