pub enum ValueCodecRegistryError {
DuplicateId {
id: &'static str,
sources: Vec<ValueCodecRegistrationSource>,
},
}Expand description
Failure while freezing a value-codec registry.
Freezing rejects duplicate stable IDs and reports the lexically first conflicting ID together with all of its declaration sites. Sources are sorted by their fields; repeated identical sources are retained because each registration is reported.
The registry returns this error when ValueStringCodecRegistry::try_global
or ValueBytesCodecRegistry::try_global encounters conflicting linked
registrations.
§Examples
use qubit_codec::ValueBytesCodecRegistry;
use qubit_codec::ValueCodecRegistryError;
fn describe_registry_error(error: ValueCodecRegistryError) -> String {
match error {
ValueCodecRegistryError::DuplicateId { id, sources } => {
format!("duplicate value codec ID {id} from {} source(s)", sources.len())
}
}
}
if let Err(error) = ValueBytesCodecRegistry::try_global() {
let description = describe_registry_error(error);
assert!(description.starts_with("duplicate value codec ID "));
}Variants§
DuplicateId
Multiple registrations claim one stable ID.
Fields
§
sources: Vec<ValueCodecRegistrationSource>Registration sources in deterministic order.
Trait Implementations§
Source§impl Clone for ValueCodecRegistryError
impl Clone for ValueCodecRegistryError
Source§impl Debug for ValueCodecRegistryError
impl Debug for ValueCodecRegistryError
Source§impl Display for ValueCodecRegistryError
impl Display for ValueCodecRegistryError
Source§impl Error for ValueCodecRegistryError
impl Error for ValueCodecRegistryError
1.30.0 · 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()
Auto Trait Implementations§
impl Forget for ValueCodecRegistryError
impl Freeze for ValueCodecRegistryError
impl RefUnwindSafe for ValueCodecRegistryError
impl Send for ValueCodecRegistryError
impl Sync for ValueCodecRegistryError
impl Unpin for ValueCodecRegistryError
impl UnsafeUnpin for ValueCodecRegistryError
impl UnwindSafe for ValueCodecRegistryError
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