[][src]Struct bishop::bishop_art::BishopArt

pub struct BishopArt { /* fields omitted */ }

Visualizer

Methods

impl BishopArt[src]

pub fn with_size(w: usize, h: usize) -> Result<BishopArt>[src]

Creates new BishopArt instance

Arguments

  • w - width of the field
  • h - height of the field

Field size must be within limits defined in GEOMETRY_LIMITS_MIN and GEOMETRY_LIMITS_MAX

Errors

Returns BishopError::Err on limits violation

Important traits for BishopArt
pub fn new() -> BishopArt[src]

Creates new BishopArt instance with default field size

pub fn input<T: AsRef<[u8]>>(&mut self, i: T)[src]

Push bytes for visualising.

You can push any amount of data until result() is called

Note that pushed data is drawn on field as-is, without any additional hashing. Amount of data effective for visualizing on field with default size is somewhere around 64 bytes. Consider using hashing if your data is bigger than this

pub fn chain<T: AsRef<[u8]>>(self, i: T) -> Self[src]

Same as input() but suitable for chaining

Example

let art = BishopArt::new()
    .chain(b"foo")
    .chain(b"bar")
    .draw();

pub fn result(self) -> BishopResult[src]

Finalize the field and return BishopResult

Note that this method consumes BishopArt

pub fn draw_with_opts(self, o: &DrawingOptions) -> String[src]

Draw resulting field to String using parameters from DrawingOptions

Note that this method calls result() internally and therefore consumes BishopArt. If you want to reuse generated field for drawing it multiple times - use result() manually.

pub fn draw(self) -> String[src]

Draw resulting field to String using default parameters

Note that this method calls result() internally and therefore consumes BishopArt. If you want to reuse generated field for drawing it multiple times - use result() manually.

Trait Implementations

impl Debug for BishopArt[src]

impl Write for BishopArt[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]