Struct bat::Input[][src]

pub struct Input<'a> { /* fields omitted */ }

An input source for the pretty printer.

Implementations

impl<'a> Input<'a>[src]

pub fn from_reader<R: Read + 'a>(reader: R) -> Self[src]

A new input from a reader.

pub fn from_file(path: impl AsRef<OsStr>) -> Self[src]

A new input from a file.

pub fn from_bytes(bytes: &'a [u8]) -> Self[src]

A new input from bytes.

pub fn from_stdin() -> Self[src]

A new input from STDIN.

pub fn name(self, name: impl AsRef<OsStr>) -> Self[src]

The filename of the input. This affects syntax detection and changes the default header title.

pub fn kind(self, kind: impl Into<String>) -> Self[src]

The description for the type of input (e.g. “File”)

pub fn title(self, title: impl Into<String>) -> Self[src]

The title for the input (e.g. “http://example.com/example.txt”) This defaults to the file name.

Trait Implementations

impl<'a> Into<Input<'a>> for Input<'a>[src]

impl<'a> Into<Input<'a>> for Input<'a>[src]

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Input<'a>

impl<'a> !Send for Input<'a>

impl<'a> !Sync for Input<'a>

impl<'a> Unpin for Input<'a>

impl<'a> !UnwindSafe for Input<'a>

Blanket Implementations

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

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

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

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

impl<T, U> Into<U> for T where
    U: From<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.