Struct gbfs::GBFSFilesystem

source ·
#[repr(align(4))]
#[repr(C)]
pub struct GBFSFilesystem<'a> { /* private fields */ }
Expand description

A filesystem that files can be read from.

Implementations§

Constructs a new filesystem from a GBFS-formatted byte slice.

To make lifetime management easier it’s probably a good idea to use a slice with a static lifetime here. It’s also a good idea to ensure this function is called at compile time with a const argument, to avoid having to store the filesystem index in RAM.

Returns a reference to the file data as a slice of u8’s. An error is returned if the file does not exist or the filename is invalid. All filenames longer than FILENAME_LEN characters are invalid.

Returns a reference to the file data as a slice of u32’s. An error is returned if the file does not exist, it’s length is not a multiple of 2 or the filename is invalid. All filenames longer than 24 characters are invalid.

Returns a reference to the file data as a slice of u32’s. An error is returned if the file does not exist, it’s length is not a multiple of 4 or the filename is invalid. All filenames longer than 24 characters are invalid.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. 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

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.