Skip to main content

Decidable

Trait Decidable 

Source
pub trait Decidable {
    // Required methods
    fn id(&self) -> Id;
    fn status(&self) -> Status;
    fn accept(&mut self) -> Result<()>;
    fn reject(&mut self) -> Result<()>;
}
Expand description

Represents an element that can be decided. Decidable objects are transactions, blocks, or vertices. ref. https://pkg.go.dev/github.com/ava-labs/avalanchego/snow/choices#Decidable

Required Methods§

Source

fn id(&self) -> Id

Returns the ID of this block’s parent.

Source

fn status(&self) -> Status

Returns the current status.

Source

fn accept(&mut self) -> Result<()>

Accepts this element. TODO: use https://docs.rs/tokio-context/latest/tokio_context?

Source

fn reject(&mut self) -> Result<()>

Rejects this element. TODO: use https://docs.rs/tokio-context/latest/tokio_context?

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§