pub struct OverlayStack { /* private fields */ }Expand description
A stack of overlays with focus management.
The topmost overlay receives keyboard input. Overlays are dismissed
with Esc (pops the top) and never block Ctrl+C.
Implementations§
Source§impl OverlayStack
impl OverlayStack
Sourcepub fn top_kind(&self) -> Option<OverlayKind>
pub fn top_kind(&self) -> Option<OverlayKind>
Get the topmost overlay kind (if any).
Sourcepub fn push(&mut self, entry: OverlayEntry)
pub fn push(&mut self, entry: OverlayEntry)
Push an overlay onto the stack. If an overlay of the same kind already exists, it is replaced (moved to top).
Sourcepub fn toggle(&mut self, entry: OverlayEntry)
pub fn toggle(&mut self, entry: OverlayEntry)
Toggle an overlay: if the kind is already showing, dismiss it; otherwise push it.
Sourcepub fn pop(&mut self) -> Option<OverlayEntry>
pub fn pop(&mut self) -> Option<OverlayEntry>
Dismiss (pop) the topmost overlay. Returns the dismissed entry.
Sourcepub fn dismiss(&mut self, kind: OverlayKind)
pub fn dismiss(&mut self, kind: OverlayKind)
Dismiss a specific overlay kind.
Sourcepub fn render(&self, frame: &mut Frame<'_>, area: Rect)
pub fn render(&self, frame: &mut Frame<'_>, area: Rect)
Render all overlays onto the frame, from bottom to top.
Sourcepub fn iter(&self) -> impl Iterator<Item = &OverlayEntry>
pub fn iter(&self) -> impl Iterator<Item = &OverlayEntry>
Get an iterator over overlay entries (bottom to top).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OverlayStack
impl RefUnwindSafe for OverlayStack
impl Send for OverlayStack
impl Sync for OverlayStack
impl Unpin for OverlayStack
impl UnsafeUnpin for OverlayStack
impl UnwindSafe for OverlayStack
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request