pub struct LoggerWriter {}

Implementations§

source§

impl LoggerWriter

source

pub fn new() -> Self

Examples found in repository?
examples/csv_reader_with_headers.rs (line 39)
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
fn main() -> std::io::Result<()> {
    let csv = "year,make,model,description
    1948,Porsche,356,Luxury sports car
    1967,Ford,Mustang fastback 1967,American car";

    let reader = CsvItemReaderBuilder::new()
        .has_headers(true)
        .delimiter(b',')
        .from_reader(csv.as_bytes());

    let writer = LoggerWriter::new();

    let step: Step<Record, Record> = StepBuilder::new()
        .reader(&reader)
        .writer(&writer)
        .chunk(4)
        .build();

    step.execute();

    Ok(())
}
More examples
Hide additional examples
examples/json_reader.rs (line 21)
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
fn main() -> std::io::Result<()> {
    let path = Path::new("examples/data/persons.json");

    let file = File::options()
        .append(true)
        .read(true)
        .create(false)
        .open(path)
        .expect("Unable to open file");

    let reader = JsonItemReaderBuilder::new().from_reader(file);

    let writer = LoggerWriter::new();

    let step: Step<Person, Person> = StepBuilder::new()
        .reader(&reader)
        .writer(&writer)
        .chunk(4)
        .build();

    step.execute();

    Ok(())
}

Trait Implementations§

source§

impl Default for LoggerWriter

source§

fn default() -> LoggerWriter

Returns the “default value” for a type. Read more
source§

impl<T> ItemWriter<T> for LoggerWriter
where T: Display,

source§

fn write(&self, item: &T) -> Result<(), BatchError>

source§

fn flush(&self) -> Result<(), BatchError>

source§

fn open(&self) -> Result<(), BatchError>

source§

fn update(&self, _is_first_item: bool) -> Result<(), BatchError>

source§

fn close(&self) -> Result<(), BatchError>

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Fake for T

source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: Rng + ?Sized, Self: FakeBase<U>,

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V