pub struct ExportRequest<R: GridRow> { /* private fields */ }Expand description
What an export takes from the grid: the scope, the header line, the columns and how a text cell is written.
use gpui_kit_grid::{EmptyExport, ExportHeader, ExportRequest, ExportScope, GridRow};
/// The whole view, every group and tree row expanded, without a header
/// line; a file of the header line alone when there is nothing to export.
fn everything<R: GridRow>() -> ExportRequest<R> {
ExportRequest::new(ExportScope::Expanded)
.with_header(ExportHeader::None)
.with_empty(EmptyExport::HeaderOnly)
}Implementations§
Source§impl<R: GridRow> ExportRequest<R>
impl<R: GridRow> ExportRequest<R>
Sourcepub fn new(scope: ExportScope) -> Self
pub fn new(scope: ExportScope) -> Self
An export of scope with a header line, the visible columns in
screen order and the grid’s CellExport
(LiveGridState::with_cell_export).
Sourcepub fn with_header(self, header: ExportHeader) -> Self
pub fn with_header(self, header: ExportHeader) -> Self
Sets the header lines (default Titles, whatever the scope; a copy
of the selection has none).
Sourcepub fn with_empty(self, empty: EmptyExport) -> Self
pub fn with_empty(self, empty: EmptyExport) -> Self
Sets what an export of an empty scope does (default
EmptyExport::Nothing).
Sourcepub fn with_columns(self, columns: impl IntoIterator<Item = R::Column>) -> Self
pub fn with_columns(self, columns: impl IntoIterator<Item = R::Column>) -> Self
Exports these columns in this order, hidden ones included; columns
the schema does not hold are left out. By default: the visible
columns in screen order; for ExportScope::Selection in a cell
mode, the visible columns that hold a selected cell.
Sourcepub fn with_cell_export(self, cells: CellExport<R>) -> Self
pub fn with_cell_export(self, cells: CellExport<R>) -> Self
Sets how a text format writes a cell (default: the grid’s).
Sourcepub fn scope(&self) -> ExportScope
pub fn scope(&self) -> ExportScope
The rows the export takes.
Sourcepub fn header(&self) -> ExportHeader
pub fn header(&self) -> ExportHeader
The header lines.
Sourcepub fn empty(&self) -> EmptyExport
pub fn empty(&self) -> EmptyExport
What an export of an empty scope does.
Trait Implementations§
Source§impl<R: GridRow> Clone for ExportRequest<R>
impl<R: GridRow> Clone for ExportRequest<R>
Auto Trait Implementations§
impl<R> Freeze for ExportRequest<R>
impl<R> !RefUnwindSafe for ExportRequest<R>
impl<R> Send for ExportRequest<R>
impl<R> Sync for ExportRequest<R>
impl<R> Unpin for ExportRequest<R>
impl<R> UnsafeUnpin for ExportRequest<R>
impl<R> !UnwindSafe for ExportRequest<R>
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
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> DowncastSync for T
impl<T> DowncastSync for T
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().