|
@@ -34,7 +34,7 @@ pub trait Io : Sized {
|
|
|
/// The user can select what type to use for length, which determines max string length.
|
|
/// The user can select what type to use for length, which determines max string length.
|
|
|
/// For custom types that implement this the length type should be passed to fields that implement LenIo.
|
|
/// For custom types that implement this the length type should be passed to fields that implement LenIo.
|
|
|
/// If you do not write any length fields that could benefit from this, do not use LenIo and use `Io` instead with the derive macro.
|
|
/// If you do not write any length fields that could benefit from this, do not use LenIo and use `Io` instead with the derive macro.
|
|
|
-/// The derive macro can be used for example with `#[io(len = u16)]` to set the length type to u16.
|
|
|
|
|
|
|
+/// The derive macro can be used for example with `#[io(len(u16))]` to set the length type to u16, though this type itself must still be manually implemented.
|
|
|
pub trait LenIo : Sized {
|
|
pub trait LenIo : Sized {
|
|
|
/// Read data from the reader.
|
|
/// Read data from the reader.
|
|
|
fn read<L: Len>(r: &mut Reader) -> Result<Self>;
|
|
fn read<L: Len>(r: &mut Reader) -> Result<Self>;
|