pub struct RelayController { /* private fields */ }Expand description
Performs server-side relay with bandwidth accounting and rate limiting.
Implementations§
Source§impl RelayController
impl RelayController
pub fn new(limits: RelayBandwidth) -> Self
Sourcepub fn relay<D: TransportDispatcher>(
&self,
from: Uuid,
to: Uuid,
packet: TransportPacket,
dispatcher: &D,
) -> Result<RelayOutcome, TransportError>
pub fn relay<D: TransportDispatcher>( &self, from: Uuid, to: Uuid, packet: TransportPacket, dispatcher: &D, ) -> Result<RelayOutcome, TransportError>
Relay a packet from one peer to another with rate limiting applied to the sender.
Sourcepub fn total_bytes(&self, peer: Uuid) -> u64
pub fn total_bytes(&self, peer: Uuid) -> u64
Returns the total number of bytes relayed for a peer (sender-scoped).
Auto Trait Implementations§
impl Freeze for RelayController
impl !RefUnwindSafe for RelayController
impl Send for RelayController
impl Sync for RelayController
impl Unpin for RelayController
impl UnsafeUnpin for RelayController
impl UnwindSafe for RelayController
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