pub struct Recv<'a> { /* private fields */ }Expand description
A binary parameter value and how much of it a receive function has read.
Implementations§
Source§impl<'a> Recv<'a>
impl<'a> Recv<'a>
pub fn new(data: &'a [u8]) -> Recv<'a>
Sourcepub fn bytes(&mut self, len: usize) -> Result<&'a [u8], TypeError>
pub fn bytes(&mut self, len: usize) -> Result<&'a [u8], TypeError>
pq_copymsgbytes and pq_getmsgbytes.
Sourcepub fn byte(&mut self) -> Result<u8, TypeError>
pub fn byte(&mut self) -> Result<u8, TypeError>
pq_getmsgbyte, which has its own text for an empty value.
Sourcepub fn text(&mut self) -> Result<&'a str, TypeError>
pub fn text(&mut self) -> Result<&'a str, TypeError>
The rest of the value as a string in the server encoding, as pq_getmsgtext reads it for textrecv, varcharrecv, json_recv and the other string types. The client encoding is UTF-8, so the check is the check of pg_verify_mbstr: a zero byte or a byte sequence that is not UTF-8 is an error that shows the bytes of the bad character.
Sourcepub fn cstring(&mut self) -> Result<&'a str, TypeError>
pub fn cstring(&mut self) -> Result<&'a str, TypeError>
pq_getmsgstring: the bytes up to a zero byte, which the function reads too, as a string in the server encoding with the check of Recv::text.
pub fn i16(&mut self) -> Result<i16, TypeError>
pub fn i32(&mut self) -> Result<i32, TypeError>
pub fn i64(&mut self) -> Result<i64, TypeError>
pub fn f32(&mut self) -> Result<f32, TypeError>
pub fn f64(&mut self) -> Result<f64, TypeError>
pub fn uuid(&mut self) -> Result<[u8; 16], TypeError>
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Recv<'a>
impl<'a> RefUnwindSafe for Recv<'a>
impl<'a> Send for Recv<'a>
impl<'a> Sync for Recv<'a>
impl<'a> Unpin for Recv<'a>
impl<'a> UnsafeUnpin for Recv<'a>
impl<'a> UnwindSafe for Recv<'a>
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