pub async fn with_options(stream: T, options: Options)
        -> Result<(Self, ReplicationHandle)>
    {
        let (tx, rx) = async_channel::unbounded();
        let handle = ReplicationHandle { tx };

        let handshake = new_protocol(stream, options);
        let protocol = handshake.handshake().await?;

        let replication = Self {
            protocol,
            command_rx: rx,
            replicas: HashMap::new(),
        };

        Ok((replication, handle))
    }
/// Create `Replication` with [Options] and wait for protocol handshake.
Create `Replication` with [Options] and wait for protocol handshake.
Create ` Replication ` with [ Options ] and wait for protocol handshake .
pub async fn with_options(stream: T, options: Options)
        -> Result<(Self, ReplicationHandle)>
    {
        let (tx, rx) = async_channel::unbounded();
        let handle = ReplicationHandle { tx };
        let handshake = new_protocol(stream, options);
        let protocol = handshake.handshake().await?;
        let replication = Self {
            protocol,
            command_rx: rx,
            replicas: HashMap::new(),
        };
        Ok((replication, handle))
    }
pub async fn with_options ( stream : T , options : Options ) -> Result < ( Self , ReplicationHandle ) > { let ( tx , rx ) = async_channel :: unbounded ( ) ; let handle = ReplicationHandle { tx } ; let handshake = new_protocol ( stream , options ) ; let protocol = handshake . handshake ( ) . await ? ; let replication = Self { protocol , command_rx : rx , replicas : HashMap :: new ( ) , } ; Ok ( ( replication , handle ) ) }
Create `Replication` with [Options] and wait for protocol handshake.
Create ` Replication ` with [ Options ] and wait for protocol handshake .
stream
T
options
Options
stream
T
options
Options