Struct edhex_core::State[][src]

pub struct State {
Show 15 fields pub radix: u32, pub show_byte_numbers: bool, pub show_chars: bool, pub unsaved_changes: bool, pub filename: String, pub show_prompt: bool, pub color: bool, pub readonly: bool, pub index: usize, pub width: NonZeroUsize, pub all_bytes: Vec<u8>, pub n_padding: String, pub before_context: usize, pub after_context: usize, pub last_search: Option<Vec<u8>>,
}

Fields

radix: u32show_byte_numbers: boolshow_chars: boolunsaved_changes: boolfilename: Stringshow_prompt: boolcolor: boolreadonly: boolindex: usizewidth: NonZeroUsizeall_bytes: Vec<u8>n_padding: Stringbefore_context: usizeafter_context: usizelast_search: Option<Vec<u8>>

Implementations

Return the byte numbers necessary for the left column of a display

Note: For the forseeable future, from_reader is actually slower than drawing the entire file into memory. So until that changes, doing the latter: https://github.com/serde-rs/json/issues/160

Serialize to a json blob. Don’t include all_bytes, not only because it could be huge, but because if you load a state from disk and its bytes differ from the actual file’s on disk bytes, neither collection of bytes are canonical. User’s can write out bytes to other files at will.

Return the range self.width bytes starting at address. Could be cut short by hitting end of all bytes. Could be empty because address is past end of all bytes.

Print self.width bytes from address or cut off if at end of all bytes

Return the range for the bytes in the current row

In current row, what’s the index of the last byte to show?

returns index of the byte in the 0-th column of the main row printed (not the context rows)

returns index of the byte in the 0-th column of the last row printed This is more primitive than print_bytes. It just prints the bytes from the range.

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Performs the conversion.

Performs the conversion.

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

Performs the conversion.

Performs the conversion.

Converts the given value to a String. 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.