Struct HexViewBuilder

Source
pub struct HexViewBuilder<'a> { /* private fields */ }
Expand description

A builder for the HexView struct.

Implementations§

Source§

impl<'a> HexViewBuilder<'a>

Source

pub fn new(data: &[u8]) -> HexViewBuilder<'_>

Constructs a new HexViewBuilder for the given data.

Source

pub fn address_offset(self, offset: usize) -> HexViewBuilder<'a>

Configures the address offset of the HexView under construction.

Source

pub fn force_color(self) -> HexViewBuilder<'a>

Forces any color data to be printed in print, even if redirected to a file or pipe.

Source

pub fn codepage<'b>(self, codepage: &'b [char]) -> HexViewBuilder<'a>
where 'b: 'a,

Configures the codepage of the HexView under construction.

Source

pub fn replacement_character(self, ch: char) -> HexViewBuilder<'a>

Configures the replacement character of the HexView under construction.

The replacement character is the character that will be used for nonprintable characters in the codepage.

Source

pub fn row_width(self, width: usize) -> HexViewBuilder<'a>

Configures the row width of the HexView under construction.

Source

pub fn add_colors( self, colors: Vec<(ColorSpec, Range<usize>)>, ) -> HexViewBuilder<'a>

Adds the vector of colors to the range color printer

Source

pub fn add_color(self, color: &str, range: Range<usize>) -> HexViewBuilder<'a>

Adds the color to the given range, using a more ergonomic API

Source

pub fn finish(self) -> HexView<'a>

Constructs the HexView.

Auto Trait Implementations§

§

impl<'a> Freeze for HexViewBuilder<'a>

§

impl<'a> RefUnwindSafe for HexViewBuilder<'a>

§

impl<'a> Send for HexViewBuilder<'a>

§

impl<'a> Sync for HexViewBuilder<'a>

§

impl<'a> Unpin for HexViewBuilder<'a>

§

impl<'a> UnwindSafe for HexViewBuilder<'a>

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> Any for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Source§

fn type_name(&self) -> &'static str

Source§

impl<T> AnySync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

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.