Skip to main content

PartEncoder

Trait PartEncoder 

Source
pub trait PartEncoder<Item> {
    type Error: EncodeError;

    // Required method
    fn encode(
        &mut self,
        part: &mut PartBody,
        part_number: PartNumber,
        item: Item,
    ) -> Result<(), Self::Error>;
}
Expand description

Encodes items in the body of a part upload request.

Required Associated Types§

Source

type Error: EncodeError

The type of value returned when encoding fails.

Required Methods§

Source

fn encode( &mut self, part: &mut PartBody, part_number: PartNumber, item: Item, ) -> Result<(), Self::Error>

Encodes an item in the provided part.

The part is in the context of an active upload, and its part number is provided in case the encoding behavior depends on it.

Implementors§

Source§

impl<E, Item> PartEncoder<Item> for FramedEncoder<E>
where E: Encoder<Item>, E::Error: EncodeError,

Available on crate feature tokio-util only.
Source§

type Error = <E as Encoder<Item>>::Error

Source§

impl<Item: AsRef<str>> PartEncoder<Item> for LinesEncoder

Source§

impl<Item: Serialize> PartEncoder<Item> for CsvEncoder

Available on crate feature csv only.
Source§

impl<Item: Serialize> PartEncoder<Item> for JsonLinesEncoder