pub struct TuiPaneBackend { /* private fields */ }Expand description
A ratatui Backend that writes directly to a TuiPane’s cell buffer.
Uses double-buffering: draw() writes to a private staging buffer,
then briefly locks the pane to swap the staging buffer in.
Implementations§
Source§impl TuiPaneBackend
impl TuiPaneBackend
Sourcepub fn new(
state: Arc<RwLock<TuiState>>,
session_id: u32,
window_id: u32,
pane_id: u32,
cols: u16,
rows: u16,
) -> Self
pub fn new( state: Arc<RwLock<TuiState>>, session_id: u32, window_id: u32, pane_id: u32, cols: u16, rows: u16, ) -> Self
Create a new TuiPaneBackend.
Sourcepub fn flush_to_pane(&mut self)
pub fn flush_to_pane(&mut self)
Swap staging buffer into the pane (blocking, takes write lock).
This is called after draw() completes. The brief write lock
duration is proportional to a memcpy, not cell-by-cell iteration.
Trait Implementations§
Source§impl Backend for TuiPaneBackend
impl Backend for TuiPaneBackend
Source§fn draw<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
fn draw<'a, I>(&mut self, content: I) -> Result<(), Self::Error>
Draw the given content to the terminal screen. Read more
Source§fn hide_cursor(&mut self) -> Result<(), Self::Error>
fn hide_cursor(&mut self) -> Result<(), Self::Error>
Hide the cursor on the terminal screen. Read more
Source§fn show_cursor(&mut self) -> Result<(), Self::Error>
fn show_cursor(&mut self) -> Result<(), Self::Error>
Show the cursor on the terminal screen. Read more
Source§fn get_cursor_position(&mut self) -> Result<Position, Self::Error>
fn get_cursor_position(&mut self) -> Result<Position, Self::Error>
Get the current cursor position on the terminal screen. Read more
Source§fn set_cursor_position<P: Into<Position>>(
&mut self,
_position: P,
) -> Result<(), Self::Error>
fn set_cursor_position<P: Into<Position>>( &mut self, _position: P, ) -> Result<(), Self::Error>
Set the cursor position on the terminal screen to the given x and y coordinates. Read more
Source§fn clear_region(&mut self, _clear_type: ClearType) -> Result<(), Self::Error>
fn clear_region(&mut self, _clear_type: ClearType) -> Result<(), Self::Error>
Clears a specific region of the terminal specified by the [
ClearType] parameter Read moreSource§fn size(&self) -> Result<Size, Self::Error>
fn size(&self) -> Result<Size, Self::Error>
Get the size of the terminal screen in columns/rows as a [
Size]. Read moreSource§fn window_size(&mut self) -> Result<WindowSize, Self::Error>
fn window_size(&mut self) -> Result<WindowSize, Self::Error>
Get the size of the terminal screen in columns/rows and pixels as a [
WindowSize]. Read moreSource§fn flush(&mut self) -> Result<(), Self::Error>
fn flush(&mut self) -> Result<(), Self::Error>
Flush any buffered content to the terminal screen.
§fn append_lines(&mut self, _n: u16) -> Result<(), Self::Error>
fn append_lines(&mut self, _n: u16) -> Result<(), Self::Error>
Insert
n line breaks to the terminal screen. Read moreAuto Trait Implementations§
impl Freeze for TuiPaneBackend
impl !RefUnwindSafe for TuiPaneBackend
impl Send for TuiPaneBackend
impl Sync for TuiPaneBackend
impl Unpin for TuiPaneBackend
impl UnsafeUnpin for TuiPaneBackend
impl !UnwindSafe for TuiPaneBackend
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§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>
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§impl<T> JaggedSlice<T> for T
impl<T> JaggedSlice<T> for T
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more