pub struct DataConverter { /* private fields */ }
Expand description

A structure representing a pipeline of conversions to be applied to a blob

Implementations§

source§

impl DataConverter

source

pub fn new_empty() -> DataConverter

Create a new empty DataConverter

source

pub fn is_empty(&self) -> bool

Return true if the DataConverter has an empty pipeline

source

pub fn new_tile_recompressor( src_form: &TileFormat, src_comp: &Compression, dst_form: &TileFormat, dst_comp: &Compression, force_recompress: bool ) -> DataConverter

Create a new DataConverter for tile recompression from src_form and src_comp to dst_form and dst_comp with optional forced recompression

source

pub fn new_compressor(dst_comp: &Compression) -> DataConverter

Constructs a new DataConverter instance that compresses data using the specified compression algorithm. The dst_comp parameter specifies the compression algorithm to use: Compression::Uncompressed, Compression::Gzip, or Compression::Brotli.

source

pub fn new_decompressor(src_comp: &Compression) -> DataConverter

Constructs a new DataConverter instance that decompresses data using the specified compression algorithm. The src_comp parameter specifies the compression algorithm to use: Compression::Uncompressed, Compression::Gzip, or Compression::Brotli.

source

pub fn process_blob(&self, blob: Blob) -> Result<Blob>

Runs the data through the pipeline of conversion functions and returns the result.

source

pub fn process_stream<'a>(&'a self, stream: TileStream<'a>) -> TileStream<'a>

Runs a stream through the pipeline of conversion functions

source

pub fn as_string(&self) -> String

Returns a string describing the pipeline of conversion functions.

Trait Implementations§

source§

impl Clone for DataConverter

source§

fn clone(&self) -> DataConverter

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for DataConverter

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for DataConverter

Implements the PartialEq trait for the DataConverter struct. This function returns true if the description method of both DataConverter instances returns the same value.

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for DataConverter

Implements the Eq trait for the DataConverter struct. This trait is used in conjunction with PartialEq to provide a total equality relation for DataConverter instances.

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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.