pub fn propose(&mut self, data: Bytes) -> Result<(), RaftError> {
        let mut ent = Entry::new();
        ent.set_Data(data);
        let mut msg = Message::new();
        msg.set_field_type(MessageType::MsgProp);
        msg.set_from(self.raft.id);
        msg.set_entries(RepeatedField::from_slice(&vec![ent]));
        self.raft.step(msg)
    }
/// Propose propose data be appended to the raft log.
Propose propose data be appended to the raft log.
Propose propose data be appended to the raft log .
pub fn propose(&mut self, data: Bytes) -> Result<(), RaftError> {
        let mut ent = Entry::new();
        ent.set_Data(data);
        let mut msg = Message::new();
        msg.set_field_type(MessageType::MsgProp);
        msg.set_from(self.raft.id);
        msg.set_entries(RepeatedField::from_slice(&vec![ent]));
        self.raft.step(msg)
    }
pub fn propose ( & mut self , data : Bytes ) -> Result < ( ) , RaftError > { let mut ent = Entry :: new ( ) ; ent . set_Data ( data ) ; let mut msg = Message :: new ( ) ; msg . set_field_type ( MessageType :: MsgProp ) ; msg . set_from ( self . raft . id ) ; msg . set_entries ( RepeatedField :: from_slice ( & vec ! [ ent ] ) ) ; self . raft . step ( msg ) }
Propose propose data be appended to the raft log.
Propose propose data be appended to the raft log .
&mut self
data
Bytes