pub struct RowDetailView { /* private fields */ }Expand description
Row detail view widget for displaying a single record
Shows all fields and their values for a selected row, with scrolling support for large text values.
§Example
ⓘ
let adapter = DatasetAdapter::from_dataset(&dataset)?;
let detail = RowDetailView::new(&adapter, 5); // Row 5
for line in detail.render_lines() {
println!("{}", line);
}Implementations§
Source§impl RowDetailView
impl RowDetailView
Sourcepub fn new(adapter: &DatasetAdapter, row_index: usize) -> Option<Self>
pub fn new(adapter: &DatasetAdapter, row_index: usize) -> Option<Self>
Sourcepub fn with_dimensions(
adapter: &DatasetAdapter,
row_index: usize,
width: u16,
height: u16,
) -> Option<Self>
pub fn with_dimensions( adapter: &DatasetAdapter, row_index: usize, width: u16, height: u16, ) -> Option<Self>
Create a new row detail view with specific dimensions
Sourcepub fn field_count(&self) -> usize
pub fn field_count(&self) -> usize
Get the number of fields
Sourcepub fn field_value(&self, name: &str) -> Option<&str>
pub fn field_value(&self, name: &str) -> Option<&str>
Get a field value by name
Sourcepub fn scroll_down(&mut self)
pub fn scroll_down(&mut self)
Scroll down
Sourcepub fn scroll_offset(&self) -> usize
pub fn scroll_offset(&self) -> usize
Get scroll offset
Sourcepub fn render_lines(&self) -> Vec<String>
pub fn render_lines(&self) -> Vec<String>
Render the detail view as lines
Trait Implementations§
Source§impl Clone for RowDetailView
impl Clone for RowDetailView
Source§fn clone(&self) -> RowDetailView
fn clone(&self) -> RowDetailView
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RowDetailView
impl RefUnwindSafe for RowDetailView
impl Send for RowDetailView
impl Sync for RowDetailView
impl Unpin for RowDetailView
impl UnsafeUnpin for RowDetailView
impl UnwindSafe for RowDetailView
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.