Trait icu_provider::export::DataExporter

source ·
pub trait DataExporter: Sync {
    // Required method
    fn put_payload(
        &self,
        marker: DataMarkerInfo,
        id: DataIdentifierBorrowed<'_>,
        payload: &DataPayload<ExportMarker>,
    ) -> Result<(), DataError>;

    // Provided methods
    fn flush_singleton(
        &self,
        marker: DataMarkerInfo,
        payload: &DataPayload<ExportMarker>,
        metadata: FlushMetadata,
    ) -> Result<(), DataError> { ... }
    fn flush(
        &self,
        _marker: DataMarkerInfo,
        _metadata: FlushMetadata,
    ) -> Result<(), DataError> { ... }
    fn close(&mut self) -> Result<ExporterCloseMetadata, DataError> { ... }
}
Expand description

An object capable of exporting data payloads in some form.

Required Methods§

source

fn put_payload( &self, marker: DataMarkerInfo, id: DataIdentifierBorrowed<'_>, payload: &DataPayload<ExportMarker>, ) -> Result<(), DataError>

Save a payload corresponding to the given marker and locale.

Takes non-mut self as it can be called concurrently.

Provided Methods§

source

fn flush_singleton( &self, marker: DataMarkerInfo, payload: &DataPayload<ExportMarker>, metadata: FlushMetadata, ) -> Result<(), DataError>

Function called for singleton markers.

Takes non-mut self as it can be called concurrently.

source

fn flush( &self, _marker: DataMarkerInfo, _metadata: FlushMetadata, ) -> Result<(), DataError>

Function called after a non-singleton marker has been fully enumerated.

Takes non-mut self as it can be called concurrently.

source

fn close(&mut self) -> Result<ExporterCloseMetadata, DataError>

This function has to be called before the object is dropped (after all markers have been fully dumped). This conceptually takes ownership, so clients may not interact with this object after close has been called.

Trait Implementations§

source§

impl DataExporter for Box<dyn DataExporter>

source§

fn put_payload( &self, marker: DataMarkerInfo, id: DataIdentifierBorrowed<'_>, payload: &DataPayload<ExportMarker>, ) -> Result<(), DataError>

Save a payload corresponding to the given marker and locale. Read more
source§

fn flush_singleton( &self, marker: DataMarkerInfo, payload: &DataPayload<ExportMarker>, metadata: FlushMetadata, ) -> Result<(), DataError>

Function called for singleton markers. Read more
source§

fn flush( &self, marker: DataMarkerInfo, metadata: FlushMetadata, ) -> Result<(), DataError>

Function called after a non-singleton marker has been fully enumerated. Read more
source§

fn close(&mut self) -> Result<ExporterCloseMetadata, DataError>

This function has to be called before the object is dropped (after all markers have been fully dumped). This conceptually takes ownership, so clients may not interact with this object after close has been called.

Implementations on Foreign Types§

source§

impl DataExporter for Box<dyn DataExporter>

Implementors§