stuckliste

Struct NamedBlocks

Source
pub struct NamedBlocks { /* private fields */ }
Expand description

Blocks addressed by a well-known name.

Implementations§

Source§

impl NamedBlocks

Source

pub fn new() -> Self

Construct empty named blocks.

Source

pub fn len(&self) -> usize

Get the number of named blocks.

Source

pub fn is_empty(&self) -> bool

Is there are no blocks?

Source

pub fn insert(&mut self, name: CString, block: u32)

Add a new named block.

Source

pub fn remove(&mut self, name: &CStr) -> Option<u32>

Remove existing named block.

Source

pub fn get(&self, name: &CStr) -> Option<u32>

Get named block.

Source

pub fn into_inner(self) -> HashMap<CString, u32>

Transform into inner representation.

Trait Implementations§

Source§

impl BigEndianRead for NamedBlocks

Source§

fn read_be<R: Read>(reader: R) -> Result<Self, Error>

Read Self from reader using big-endian byte order.
Source§

impl BigEndianWrite for NamedBlocks

Source§

fn write_be<W: Write>(&self, writer: W) -> Result<(), Error>

Write self to write using big-endian byte order.
Source§

impl Debug for NamedBlocks

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for NamedBlocks

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T, C> BlockRead<C> for T
where T: BigEndianRead,

Source§

fn read_block( i: u32, file: &[u8], blocks: &mut Blocks, _context: &mut C, ) -> Result<T, Error>

Read Self from block i.
Source§

impl<T, C> BlockWrite<C> for T
where T: BigEndianWrite,

Source§

fn write_block<W>( &self, writer: W, blocks: &mut Blocks, _context: &mut C, ) -> Result<u32, Error>
where W: Write + Seek,

Write self to a block and return its index.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.