[−][src]Struct bishop::bishop_art::BishopArt
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 fieldh
- 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 BishopArtpub 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]
Trait Implementations
impl Debug for BishopArt
[src]
impl Write for BishopArt
[src]
fn write(&mut self, buf: &[u8]) -> Result<usize>
[src]
fn flush(&mut self) -> Result<()>
[src]
fn write_vectored(&mut self, bufs: &[IoSlice]) -> Result<usize, Error>
1.36.0[src]
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
1.0.0[src]
fn write_fmt(&mut self, fmt: Arguments) -> Result<(), Error>
1.0.0[src]
fn by_ref(&mut self) -> &mut Self
1.0.0[src]
Auto Trait Implementations
impl Send for BishopArt
impl Sync for BishopArt
impl Unpin for BishopArt
impl UnwindSafe for BishopArt
impl RefUnwindSafe for BishopArt
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,