[−][src]Function pgx::varlena::varlena_to_byte_slice
pub unsafe fn varlena_to_byte_slice<'a>(varlena: *const varlena) -> &'a [u8]
Convert a Postgres varlena *
(or byte *
) into a Rust &[u8]
.
Safety
This function is unsafe because it blindly assumes the provided varlena pointer is non-null.
Note also that this function is zero-copy and the underlying Rust &[u8]
slice is backed by Postgres-allocated
memory. As such, the return value will become invalid the moment Postgres frees the varlena