pub struct MessageWriter { /* private fields */ }Expand description
Buffer for writing PostgreSQL protocol messages.
All multi-byte integers are written in big-endian (network) byte order.
Implementations§
Source§impl MessageWriter
impl MessageWriter
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new message writer with specified capacity.
Sourcepub fn take(&mut self) -> Vec<u8> ⓘ
pub fn take(&mut self) -> Vec<u8> ⓘ
Take ownership of the buffer, leaving an empty one in its place.
Sourcepub fn write(&mut self, msg: &FrontendMessage) -> &[u8] ⓘ
pub fn write(&mut self, msg: &FrontendMessage) -> &[u8] ⓘ
Encode a frontend message into the buffer.
Returns a slice to the encoded message data.
Trait Implementations§
Source§impl Clone for MessageWriter
impl Clone for MessageWriter
Source§fn clone(&self) -> MessageWriter
fn clone(&self) -> MessageWriter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MessageWriter
impl Debug for MessageWriter
Auto Trait Implementations§
impl Freeze for MessageWriter
impl RefUnwindSafe for MessageWriter
impl Send for MessageWriter
impl Sync for MessageWriter
impl Unpin for MessageWriter
impl UnwindSafe for MessageWriter
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).