pub trait UpdateSettings: Sized + ScryptoSbor {
type UpdateGenerator: ProtocolUpdateGenerator;
// Required methods
fn protocol_version() -> ProtocolVersion;
fn all_enabled_as_default_for_network(network: &NetworkDefinition) -> Self;
fn all_disabled() -> Self;
fn create_generator(&self) -> Self::UpdateGenerator;
// Provided methods
fn enable(
self,
prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<NoSettings>,
) -> Self { ... }
fn enable_with<T>(
self,
prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<T>,
setting: T,
) -> Self
where T: UpdateSettingContent { ... }
fn disable<T>(
self,
prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<T>,
) -> Self
where T: UpdateSettingContent { ... }
fn set(self, updater: impl FnOnce(&mut Self)) -> Self { ... }
}
Expand description
This requires ScryptoSbor
so it can be used to override configuration in the node for tests.
Required Associated Types§
Required Methods§
fn protocol_version() -> ProtocolVersion
fn all_enabled_as_default_for_network(network: &NetworkDefinition) -> Self
fn all_disabled() -> Self
fn create_generator(&self) -> Self::UpdateGenerator
Provided Methods§
fn enable( self, prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<NoSettings>, ) -> Self
fn enable_with<T>(
self,
prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<T>,
setting: T,
) -> Selfwhere
T: UpdateSettingContent,
fn disable<T>(
self,
prop: impl FnOnce(&mut Self) -> &mut UpdateSetting<T>,
) -> Selfwhere
T: UpdateSettingContent,
fn set(self, updater: impl FnOnce(&mut Self)) -> Self
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.