pub struct RegistrationOptions<T: 'static> { /* private fields */ }Expand description
Builder for configuring per-key registration options.
Obtained via the callback in RegistryBuilder::try_register_with.
§Examples
ⓘ
builder.register_with::<Config>("config", |opts| opts
.version(1)
.codec(
|val| serde_json::to_vec(val).map_err(|e| e.to_string()),
|bytes| serde_json::from_slice(bytes).map_err(|e| e.to_string()),
)
);Implementations§
Source§impl<T: 'static> RegistrationOptions<T>
impl<T: 'static> RegistrationOptions<T>
Sourcepub fn local_only(self) -> Self
pub fn local_only(self) -> Self
Mark as local-only: propagates via snapshot/attach but excluded from
serialization. The type does not need Serialize/DeserializeOwned.
Auto Trait Implementations§
impl<T> Freeze for RegistrationOptions<T>
impl<T> !RefUnwindSafe for RegistrationOptions<T>
impl<T> Send for RegistrationOptions<T>
impl<T> Sync for RegistrationOptions<T>
impl<T> Unpin for RegistrationOptions<T>
impl<T> UnsafeUnpin for RegistrationOptions<T>
impl<T> !UnwindSafe for RegistrationOptions<T>
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