pub struct OmaColorFormat {
pub theme: Option<Theme>,
/* private fields */
}Fields§
§theme: Option<Theme>Implementations§
Source§impl OmaColorFormat
impl OmaColorFormat
Sourcepub fn new(follow: bool, duration: Duration) -> Self
pub fn new(follow: bool, duration: Duration) -> Self
Examples found in repository?
examples/pager.rs (line 33)
32 33 34 35 36 37 38 39 40 41 42 43 44
fn main() -> io::Result<()> {
let cf = OmaColorFormat::new(true, Duration::from_millis(100));
let pager = OmaPager::new(Some("QAQ".to_string()), &cf, &OmaPagerUIText);
let mut p = Pager::External(Box::new(pager));
let mut w = p.get_writer()?;
w.write_all("QAQ\n".cyan().to_string().as_bytes()).ok();
w.write_all(b"PAP").ok();
drop(w);
p.wait_for_exit()?;
Ok(())
}pub fn color_str<D>(&self, input: D, color: Action) -> StyledObject<D>
Auto Trait Implementations§
impl Freeze for OmaColorFormat
impl RefUnwindSafe for OmaColorFormat
impl Send for OmaColorFormat
impl Sync for OmaColorFormat
impl Unpin for OmaColorFormat
impl UnwindSafe for OmaColorFormat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more