pub struct Convert;Expand description
Allows conversions between byte arrays and other types.
§Example
use tftpd::Convert;
assert_eq!(Convert::to_u16(&[0x01, 0x02]).unwrap(), 0x0102);
let (result, index) = Convert::to_string(b"hello world\0", 0).unwrap();
assert_eq!(result, "hello world");
assert_eq!(index, 11);Implementations§
Auto Trait Implementations§
impl Freeze for Convert
impl RefUnwindSafe for Convert
impl Send for Convert
impl Sync for Convert
impl Unpin for Convert
impl UnwindSafe for Convert
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