pub struct Sized<T, S, F>(pub F, pub T) 
where
    T: WriteInto,
    S: WriteInto,
    F: FnOnce(usize) -> S
;
Expand description

Used to write values prepended with size of their representation.

Example

use write_into::{Sized, Plain, Uleb128, write_into};

let mut buffer = Vec::new();
let written = write_into(&mut buffer, Sized(Uleb128, Plain("Hello, Sailor!"))).unwrap();
assert_eq!(written, 14);
assert_eq!(&buffer, b"\x0EHello, Sailor!");

Tuple Fields

0: F1: T

Trait Implementations

Returns how many bytes was taken by the representation of T.

Result of WriteInto::write_into function (e.g. () or usize).

Writes value into I/O sink.

Returns how many bytes was taken by the representation of T.

Result of WriteInto::write_into function (e.g. () or usize).

Writes value into I/O sink.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.