[][src]Function pgx::varlena::text_to_rust_str_unchecked

pub unsafe fn text_to_rust_str_unchecked<'a>(varlena: *const varlena) -> &'a str

Convert a Postgres varlena * (or text *) into a Rust &str.

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 &str is backed by Postgres-allocated memory. As such, the return value will become invalid the moment Postgres frees the varlena