pub struct LogViewHandle { /* private fields */ }Expand description
A cloneable handle to append to a LogView and drive it.
Use it on the UI thread — from an event handler, a timer, or an async
completion. It holds an Rc, so it is not Send; feeding a log from a
background thread (a PTY reader, a tracing layer) means marshalling the lines
to the UI thread first — through the app’s async executor, or a channel whose
receiver is drained in a handler. Each append wakes the view, which otherwise
stops asking for frames when idle.
Implementations§
Source§impl LogViewHandle
impl LogViewHandle
Sourcepub fn append(&self, text: &str)
pub fn append(&self, text: &str)
Append text, split into lines on \n. A single trailing newline is a
terminator, not a blank line, so it is dropped; embedded blank lines are
kept. Enqueues for the next frame and wakes the view.
Sourcepub fn append_line(&self, line: &str)
pub fn append_line(&self, line: &str)
Append one line. \n is still split defensively — the document rejects a
block containing one — so a value that turns out to be multi-line becomes
several lines rather than an error.
Sourcepub fn append_lines<I, S>(&self, lines: I)
pub fn append_lines<I, S>(&self, lines: I)
Append many lines.
Sourcepub fn scroll_to_bottom(&self)
pub fn scroll_to_bottom(&self)
Scroll to the bottom, resuming tail-following. UI-thread only.
Sourcepub fn line_count(&self) -> Signal<usize>
pub fn line_count(&self) -> Signal<usize>
The live line count — a status bar can bind it.
Sourcepub fn document_version(&self) -> Signal<u64>
pub fn document_version(&self) -> Signal<u64>
Bumps on every content change.
Sourcepub fn scroll_y(&self) -> Signal<f32>
pub fn scroll_y(&self) -> Signal<f32>
The vertical scroll offset — a follow-state indicator can read it against
max_scroll_y.
Sourcepub fn max_scroll_y(&self) -> Signal<f32>
pub fn max_scroll_y(&self) -> Signal<f32>
The maximum vertical scroll offset.
Trait Implementations§
Source§impl Clone for LogViewHandle
impl Clone for LogViewHandle
Source§fn clone(&self) -> LogViewHandle
fn clone(&self) -> LogViewHandle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for LogViewHandle
impl !Send for LogViewHandle
impl !Sync for LogViewHandle
impl !UnwindSafe for LogViewHandle
impl Freeze for LogViewHandle
impl Unpin for LogViewHandle
impl UnsafeUnpin for LogViewHandle
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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