pub struct StreamingBuilder<W: IoWrite> { /* private fields */ }Expand description
Streaming DDEX XML builder
Implementations§
Source§impl<W: IoWrite> StreamingBuilder<W>
impl<W: IoWrite> StreamingBuilder<W>
Sourcepub fn new(writer: W) -> Result<Self, BuildError>
pub fn new(writer: W) -> Result<Self, BuildError>
Create a new streaming builder with the given writer
Sourcepub fn new_with_config(
writer: W,
config: StreamingConfig,
) -> Result<Self, BuildError>
pub fn new_with_config( writer: W, config: StreamingConfig, ) -> Result<Self, BuildError>
Create a new streaming builder with custom configuration
Sourcepub fn set_progress_callback(&mut self, callback: ProgressCallback)
pub fn set_progress_callback(&mut self, callback: ProgressCallback)
Set a progress callback function
Sourcepub fn set_estimated_total(&mut self, total: usize)
pub fn set_estimated_total(&mut self, total: usize)
Set estimated total number of items for progress calculation
Sourcepub fn start_message(
&mut self,
header: &MessageHeaderRequest,
version: &str,
) -> Result<(), BuildError>
pub fn start_message( &mut self, header: &MessageHeaderRequest, version: &str, ) -> Result<(), BuildError>
Start the DDEX message with header information
Sourcepub fn write_resource(
&mut self,
resource_id: &str,
title: &str,
artist: &str,
isrc: Option<&str>,
duration: Option<&str>,
file_path: Option<&str>,
) -> Result<String, BuildError>
pub fn write_resource( &mut self, resource_id: &str, title: &str, artist: &str, isrc: Option<&str>, duration: Option<&str>, file_path: Option<&str>, ) -> Result<String, BuildError>
Write a single resource to the stream
Sourcepub fn finish_resources_start_releases(&mut self) -> Result<(), BuildError>
pub fn finish_resources_start_releases(&mut self) -> Result<(), BuildError>
Finish the resource section and start the release section
Sourcepub fn write_release(
&mut self,
release_id: &str,
title: &str,
artist: &str,
label: Option<&str>,
upc: Option<&str>,
release_date: Option<&str>,
genre: Option<&str>,
resource_references: &[String],
) -> Result<String, BuildError>
pub fn write_release( &mut self, release_id: &str, title: &str, artist: &str, label: Option<&str>, upc: Option<&str>, release_date: Option<&str>, genre: Option<&str>, resource_references: &[String], ) -> Result<String, BuildError>
Write a single release to the stream
Sourcepub fn finish_message(&mut self) -> Result<StreamingStats, BuildError>
pub fn finish_message(&mut self) -> Result<StreamingStats, BuildError>
Finish the message and close all tags
Auto Trait Implementations§
impl<W> Freeze for StreamingBuilder<W>where
W: Freeze,
impl<W> !RefUnwindSafe for StreamingBuilder<W>
impl<W> Send for StreamingBuilder<W>where
W: Send,
impl<W> Sync for StreamingBuilder<W>where
W: Sync,
impl<W> Unpin for StreamingBuilder<W>where
W: Unpin,
impl<W> !UnwindSafe for StreamingBuilder<W>
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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