pub struct ExportBuilder { /* private fields */ }Expand description
Export builder for fluent API
§Examples
use reinhardt_admin::core::ExportBuilder;
use reinhardt_admin::core::export::ExportFormat;
use std::collections::HashMap;
let mut row = HashMap::new();
row.insert("id".to_string(), "1".to_string());
let result = ExportBuilder::new("User", ExportFormat::CSV)
.field("id")
.field("username")
.data(vec![row])
.build();
assert!(result.is_ok());Implementations§
Source§impl ExportBuilder
impl ExportBuilder
Sourcepub fn new(model_name: impl Into<String>, format: ExportFormat) -> Self
pub fn new(model_name: impl Into<String>, format: ExportFormat) -> Self
Create a new export builder
Sourcepub fn field_label(
self,
field: impl Into<String>,
label: impl Into<String>,
) -> Self
pub fn field_label( self, field: impl Into<String>, label: impl Into<String>, ) -> Self
Set field label
Sourcepub fn build(self) -> AdminResult<ExportResult>
pub fn build(self) -> AdminResult<ExportResult>
Build and export
Auto Trait Implementations§
impl Freeze for ExportBuilder
impl RefUnwindSafe for ExportBuilder
impl Send for ExportBuilder
impl Sync for ExportBuilder
impl Unpin for ExportBuilder
impl UnwindSafe for ExportBuilder
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> 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 more