pub enum StreamingError {
InvalidState {
message: String,
},
IoError(Error),
XmlError(Error),
BuildError(BuildError),
}Expand description
Errors that can occur during streaming operations
Comprehensive error types for streaming DDEX XML generation, including state management errors, I/O issues, and XML formatting problems.
§Example
use ddex_builder::streaming::{StreamingBuilder, StreamingError};
match streaming_builder.write_resource(/*...*/) {
Ok(resource_ref) => println!("Resource written: {}", resource_ref),
Err(StreamingError::InvalidState { message }) => {
eprintln!("Invalid state: {}", message);
}
Err(StreamingError::IoError(io_err)) => {
eprintln!("I/O error: {}", io_err);
}
Err(other_err) => eprintln!("Other error: {}", other_err),
}Variants§
InvalidState
Invalid state transition (e.g., writing resources after finishing message)
IoError(Error)
I/O error during streaming operations (writing to output, flushing buffers)
XmlError(Error)
XML writing or formatting error
BuildError(BuildError)
General build error from the underlying builder system
Trait Implementations§
Source§impl Debug for StreamingError
impl Debug for StreamingError
Source§impl Display for StreamingError
impl Display for StreamingError
Source§impl Error for StreamingError
impl Error for StreamingError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<BuildError> for StreamingError
impl From<BuildError> for StreamingError
Source§fn from(source: BuildError) -> Self
fn from(source: BuildError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for StreamingError
impl From<Error> for StreamingError
Source§impl From<Error> for StreamingError
impl From<Error> for StreamingError
Source§impl From<StreamingError> for BuildError
impl From<StreamingError> for BuildError
Source§fn from(err: StreamingError) -> Self
fn from(err: StreamingError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for StreamingError
impl !RefUnwindSafe for StreamingError
impl Send for StreamingError
impl Sync for StreamingError
impl Unpin for StreamingError
impl !UnwindSafe for StreamingError
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