pub struct Buffer { /* private fields */ }Expand description
A frontend message under construction.
Implementations§
Source§impl Buffer
impl Buffer
pub fn new() -> Self
pub fn into_bytes(self) -> Vec<u8> ⓘ
Sourcepub fn startup(&mut self, parameters: &[(&str, &str)]) -> &mut Self
pub fn startup(&mut self, parameters: &[(&str, &str)]) -> &mut Self
The startup packet, which has a length and a version but no type byte.
pub fn password(&mut self, password: &str) -> &mut Self
pub fn sasl_initial(&mut self, mechanism: &str, response: &str) -> &mut Self
pub fn sasl_response(&mut self, response: &str) -> &mut Self
Sourcepub fn query(&mut self, sql: &str) -> &mut Self
pub fn query(&mut self, sql: &str) -> &mut Self
A simple query. Multiple statements are allowed but no parameters, so this is reserved for DDL and internal bookkeeping.
Sourcepub fn parse(&mut self, name: &str, sql: &str) -> &mut Self
pub fn parse(&mut self, name: &str, sql: &str) -> &mut Self
Prepare an unnamed statement. Parameter types are left unspecified so the server infers them.
Sourcepub fn bind(
&mut self,
portal: &str,
statement: &str,
params: &[Option<String>],
) -> &mut Self
pub fn bind( &mut self, portal: &str, statement: &str, params: &[Option<String>], ) -> &mut Self
Bind parameters, sent in text format.
Text keeps the driver free of per-type binary encoders while remaining exact: the server parses each parameter with the type it inferred.
pub fn describe_portal(&mut self, portal: &str) -> &mut Self
pub fn execute(&mut self, portal: &str, max_rows: i32) -> &mut Self
pub fn sync(&mut self) -> &mut Self
pub fn terminate(&mut self) -> &mut Self
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