[−][src]Struct bat::Input
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
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]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,