as_buf

Function as_buf 

Source
pub const unsafe fn as_buf<B: ?Sized + Buf>(bytes: &[u8]) -> &B
Expand description

Converts a byte slice to a reference to a Buf.

Unlike Buf::from_bytes(), this function is const.

ยงSafety

See Buf::from_bytes().