pub struct SchemaNegotiator { /* private fields */ }Expand description
Schema negotiator state machine
Implementations§
Source§impl SchemaNegotiator
impl SchemaNegotiator
Sourcepub fn new(local_capabilities: Capabilities) -> Self
pub fn new(local_capabilities: Capabilities) -> Self
Creates a new schema negotiator with local capabilities
Sourcepub fn with_fid_mappings(self, mappings: HashMap<u16, String>) -> Self
pub fn with_fid_mappings(self, mappings: HashMap<u16, String>) -> Self
Sets FID mappings for the negotiator
Sourcepub fn initiate(&mut self) -> Result<NegotiationMessage, NegotiationError>
pub fn initiate(&mut self) -> Result<NegotiationMessage, NegotiationError>
Initiates negotiation by sending capabilities message
Sourcepub fn handle_message(
&mut self,
message: NegotiationMessage,
) -> Result<NegotiationResponse, NegotiationError>
pub fn handle_message( &mut self, message: NegotiationMessage, ) -> Result<NegotiationResponse, NegotiationError>
Handles an incoming negotiation message
Sourcepub fn state(&self) -> &NegotiationState
pub fn state(&self) -> &NegotiationState
Returns the current negotiation state
Sourcepub fn local_capabilities(&self) -> &Capabilities
pub fn local_capabilities(&self) -> &Capabilities
Returns the local capabilities
Sourcepub fn remote_capabilities(&self) -> Option<&Capabilities>
pub fn remote_capabilities(&self) -> Option<&Capabilities>
Returns the remote capabilities if received
Sourcepub fn detect_conflicts(
local_mappings: &HashMap<u16, String>,
remote_mappings: &HashMap<u16, String>,
) -> Vec<NegotiationError>
pub fn detect_conflicts( local_mappings: &HashMap<u16, String>, remote_mappings: &HashMap<u16, String>, ) -> Vec<NegotiationError>
Detects FID conflicts between two mapping sets
Returns a list of all conflicts found
Sourcepub fn detect_type_mismatches(
expected_types: &HashMap<u16, TypeTag>,
actual_types: &HashMap<u16, TypeTag>,
) -> Vec<NegotiationError>
pub fn detect_type_mismatches( expected_types: &HashMap<u16, TypeTag>, actual_types: &HashMap<u16, TypeTag>, ) -> Vec<NegotiationError>
Detects type mismatches between expected and actual types for FIDs
Returns a list of all type mismatches found
Trait Implementations§
Source§impl Clone for SchemaNegotiator
impl Clone for SchemaNegotiator
Source§fn clone(&self) -> SchemaNegotiator
fn clone(&self) -> SchemaNegotiator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SchemaNegotiator
impl RefUnwindSafe for SchemaNegotiator
impl Send for SchemaNegotiator
impl Sync for SchemaNegotiator
impl Unpin for SchemaNegotiator
impl UnwindSafe for SchemaNegotiator
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