pub struct Client { /* private fields */ }
Expand description
An instance of Simperby client (a.k.a. a ‘node’).
Implementations§
Source§impl Client
impl Client
pub async fn genesis(path: &str) -> Result<()>
pub async fn init(path: &str) -> Result<()>
pub async fn open(path: &str, config: Config, auth: Auth) -> Result<Self>
pub fn config(&self) -> &Config
pub fn auth(&self) -> &Auth
pub async fn clean(&mut self, _hard: bool) -> Result<()>
pub fn repository(&self) -> &DistributedRepository
pub fn repository_mut(&mut self) -> &mut DistributedRepository
Sourcepub async fn progress_for_consensus(&mut self) -> Result<String>
pub async fn progress_for_consensus(&mut self) -> Result<String>
Makes a progress for the consensus, returning the result.
TODO: it has to consume the object if finalized.
pub async fn vote(&mut self, agenda_commit: CommitHash) -> Result<()>
Sourcepub async fn veto_round(&mut self) -> Result<()>
pub async fn veto_round(&mut self) -> Result<()>
Vetoes the current round.
Sourcepub async fn veto_block(&mut self, _block_commit: CommitHash) -> Result<()>
pub async fn veto_block(&mut self, _block_commit: CommitHash) -> Result<()>
Vetoes the given block.
Sourcepub async fn show(&self, _commit_hash: CommitHash) -> Result<CommitInfo>
pub async fn show(&self, _commit_hash: CommitHash) -> Result<CommitInfo>
Shows information about the given commit.
For every type of commit,
- Show the content.
- Show the hash of it.
For an agenda, show the governance status. For a block, show the consensus status projected on this block. For an extra-agenda transaction and a chat log, TODO.
pub async fn serve( self, config: ServerConfig, git_hook_verifier: PushVerifier, ) -> Result<JoinHandle<Result<()>>>
pub async fn update(&mut self) -> Result<()>
pub async fn broadcast(&mut self) -> Result<()>
pub async fn add_peer( &mut self, name: MemberName, address: SocketAddrV4, ) -> Result<()>
pub async fn remove_peer(&mut self, name: MemberName) -> Result<()>
pub async fn get_peer_list(&self) -> Result<Vec<Peer>>
pub async fn update_peer(&mut self) -> Result<()>
pub async fn get_peer_status(&self) -> Result<Vec<PeerStatus>>
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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