pub trait Extension: Send + Sync {
// Required methods
fn name(&self) -> &str;
fn validate(&self, value: &ExtensionValue) -> Result<(), String>;
// Provided methods
fn transform(&self, value: ExtensionValue) -> Result<ExtensionValue, String> { ... }
fn is_compatible(&self, _version: ProtocolVersion) -> bool { ... }
}Expand description
Extension trait for custom protocol extensions
Required Methods§
Provided Methods§
Sourcefn transform(&self, value: ExtensionValue) -> Result<ExtensionValue, String>
fn transform(&self, value: ExtensionValue) -> Result<ExtensionValue, String>
Transform extension value (optional)
Sourcefn is_compatible(&self, _version: ProtocolVersion) -> bool
fn is_compatible(&self, _version: ProtocolVersion) -> bool
Check if extension is compatible with protocol version