#[non_exhaustive]pub struct RunSpec {
pub resource: String,
pub media_id: Option<i64>,
pub matches: Vec<Match>,
pub duplicates: Option<Duplicates>,
pub first_row_titles: bool,
pub delimiter: u8,
pub dry_run: bool,
pub keep_blank: bool,
pub titles: Vec<String>,
}Expand description
How one run reads its file and writes its rows.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.resource: StringThe resource whose form the rows go through, as its descriptor declares
the path (/products). Recorded on the run.
media_id: Option<i64>The stored payload’s media record, kept on the run for the report.
matches: Vec<Match>Which file column feeds which field. A column may feed several fields.
duplicates: Option<Duplicates>What a row does when its key matches a record already there. None
creates every row.
first_row_titles: boolWhether the first row names the columns and is passed over. Default
true.
delimiter: u8The byte between values. Default ,.
dry_run: boolRun every row through the rules and conversions with nothing written,
so the report says what an import would do. Default false.
keep_blank: boolOn an update, a matched cell that is blank leaves the record’s value
as it is. Default true; false clears the field.
titles: Vec<String>The file’s column titles, kept so a later file with the same titles is proposed the same matching.
Implementations§
Source§impl RunSpec
impl RunSpec
Sourcepub fn new(resource: impl Into<String>, matches: Vec<Match>) -> Self
pub fn new(resource: impl Into<String>, matches: Vec<Match>) -> Self
A run into resource with these column matches.
Sourcepub fn dry_run(self, dry: bool) -> Self
pub fn dry_run(self, dry: bool) -> Self
Run every row with nothing written; the report says what would happen.
Sourcepub fn keep_blank(self, keep: bool) -> Self
pub fn keep_blank(self, keep: bool) -> Self
Whether a blank matched cell leaves an updated record’s value as it is.
Sourcepub fn titles(self, titles: Vec<String>) -> Self
pub fn titles(self, titles: Vec<String>) -> Self
The file’s column titles, for a later file to be matched the same way.
Sourcepub fn duplicates(self, duplicates: Duplicates) -> Self
pub fn duplicates(self, duplicates: Duplicates) -> Self
What a row does when its key matches a record already there.
Sourcepub fn first_row_titles(self, titles: bool) -> Self
pub fn first_row_titles(self, titles: bool) -> Self
Whether the first row names the columns.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunSpec
impl<'de> Deserialize<'de> for RunSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for RunSpec
impl RefUnwindSafe for RunSpec
impl Send for RunSpec
impl Sync for RunSpec
impl Unpin for RunSpec
impl UnsafeUnpin for RunSpec
impl UnwindSafe for RunSpec
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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> ⓘ
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