Struct il2_iltags::io::array::BorrowedVecWriter[][src]

pub struct BorrowedVecWriter<'a> { /* fields omitted */ }
Expand description

BorrowedVecWriter implements a Writer that uses a borrowed Vec as its backend.

The borrowed vector is used as is. This means that:

  • Any existing data will be overwritten from the initial offset;
  • The vector will be extended if required but will never shrink to accomodate the amount of data written;

Implementations

Creates a new instance of this struct. The new struct is set as writeable by default.

Arguments:

  • vector: The inner vector;

Creates a new instance of this struct. The new struct is set as writeable by default.

Arguments:

  • vector: The inner vector;
  • offset: The initial offset. If it is set to a value larger than vector length, it will assume the vector length;

Returns the current writing position.

Returns:

  • The current offset. It is guaranteed to be at most the total size of the data.

Sets the current writing position.

Arguments:

  • offset: The new position. It if is larger than the total length, it will assume the total length;

Returns true if this instance is locked for writing.

Sets the read-only flag.

Arguments:

  • read_only: The new value;

Verifies if the it is possible to write into this VecWriter.

Returns:

  • Ok(()): If it is possible to write;
  • Err(ErrorKind::UnableToWriteData): If it is not possible to write;

Returns the current data as a slice.

Returns aread-only reference to the inner vector.

Returns the number of bytes actually written.

Trait Implementations

Writes a single byte. Read more

Writes a byte slice. As this default implementation calls write() multiple times, so it is strongly recommended that each implementation provides a more efficient version for this method if possible. Read more

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

Serializes a byte array as a slice. Read more

👎 Deprecated

Serializes a byte array as a vector. Read more

Performs the conversion.

Serializes an ILInt value. Read more

Writes the ILInt value. Read more

Performs the conversion.

Serializes an ILInt value. Read more

Writes the ILInt value. Read more

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.

Serializes a value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more

Writes the value. Read more