pub struct Buffer {
pub request_data: Vec<u8>,
/* private fields */
}Expand description
A buffer for request and reply data.
Fields§
§request_data: Vec<u8>The payload sent with each request. Push bytes here before sending.
Implementations§
Source§impl Buffer
impl Buffer
Sourcepub const fn with_data(request_data: Vec<u8>) -> Self
pub const fn with_data(request_data: Vec<u8>) -> Self
Creates a new buffer with the provided request data.
Sourcepub fn reply_data(&self) -> &[u8] ⓘ
pub fn reply_data(&self) -> &[u8] ⓘ
The reply data from the last ping this buffer was used in. Empty if no request was sent with this buffer, or if there was no reply.
Sourcepub fn responding_ipv4(&self) -> Option<Ipv4Addr>
pub fn responding_ipv4(&self) -> Option<Ipv4Addr>
The responding Ipv4Addr from the last request, or None if that request was v6, the buffer wasn’t used in a request, or there was no reply.
Sourcepub fn responding_ipv6(&self) -> Option<Ipv6Addr>
pub fn responding_ipv6(&self) -> Option<Ipv6Addr>
The responding Ipv6Addr from the last request, or None if that request was v4, the buffer wasn’t used in a request, or there was no reply.
Sourcepub fn responding_ip(&self) -> Option<IpAddr>
pub fn responding_ip(&self) -> Option<IpAddr>
The responding IpAddr from the last request, or None if the buffer wasn’t used in a request or there was no reply.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnsafeUnpin for Buffer
impl UnwindSafe for Buffer
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