Struct linera_execution::ChainOwnership
source · pub struct ChainOwnership {
pub super_owners: BTreeMap<Owner, PublicKey>,
pub owners: BTreeMap<Owner, (PublicKey, u64)>,
pub multi_leader_rounds: u32,
pub timeout_config: TimeoutConfig,
}
Expand description
Represents the owner(s) of a chain.
Fields§
§super_owners: BTreeMap<Owner, PublicKey>
Super owners can propose fast blocks in the first round, and regular blocks in any round.
owners: BTreeMap<Owner, (PublicKey, u64)>
The regular owners, with their weights that determine how often they are round leader.
multi_leader_rounds: u32
The number of initial rounds after 0 in which all owners are allowed to propose blocks.
timeout_config: TimeoutConfig
The timeout configuration: how long fast, multi-leader and single-leader rounds last.
Implementations§
source§impl ChainOwnership
impl ChainOwnership
pub fn single(public_key: PublicKey) -> Self
pub fn multiple( keys_and_weights: impl IntoIterator<Item = (PublicKey, u64)>, multi_leader_rounds: u32, timeout_config: TimeoutConfig ) -> Self
pub fn with_regular_owner(self, public_key: PublicKey, weight: u64) -> Self
pub fn is_active(&self) -> bool
pub fn verify_owner(&self, owner: &Owner) -> Option<PublicKey>
sourcepub fn round_timeout(&self, round: Round) -> Option<Duration>
pub fn round_timeout(&self, round: Round) -> Option<Duration>
Returns the duration of the given round.
pub fn first_round(&self) -> Round
pub fn all_owners(&self) -> impl Iterator<Item = &Owner>
pub fn next_round(&self, round: Round) -> Option<Round>
pub fn previous_round(&self, round: Round) -> Option<Round>
Trait Implementations§
source§impl Clone for ChainOwnership
impl Clone for ChainOwnership
source§fn clone(&self) -> ChainOwnership
fn clone(&self) -> ChainOwnership
Returns a copy 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 moresource§impl Debug for ChainOwnership
impl Debug for ChainOwnership
source§impl Default for ChainOwnership
impl Default for ChainOwnership
source§fn default() -> ChainOwnership
fn default() -> ChainOwnership
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for ChainOwnership
impl<'de> Deserialize<'de> for ChainOwnership
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Hash for ChainOwnership
impl Hash for ChainOwnership
source§impl InputType for ChainOwnership
impl InputType for ChainOwnership
§type RawValueType = ChainOwnership
type RawValueType = ChainOwnership
The raw type used for validator. Read more
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn parse(value: Option<Value>) -> InputValueResult<Self>
fn parse(value: Option<Value>) -> InputValueResult<Self>
Parse from
Value
. None represents undefined.source§fn as_raw_value(&self) -> Option<&Self::RawValueType>
fn as_raw_value(&self) -> Option<&Self::RawValueType>
Returns a reference to the raw value.
source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl OutputType for ChainOwnership
impl OutputType for ChainOwnership
source§fn create_type_info(registry: &mut Registry) -> String
fn create_type_info(registry: &mut Registry) -> String
Create type information in the registry and return qualified typename.
source§fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 ContextSelectionSet<'life2>,
_field: &'life3 Positioned<Field>
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn resolve<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_: &'life1 ContextSelectionSet<'life2>,
_field: &'life3 Positioned<Field>
) -> Pin<Box<dyn Future<Output = ServerResult<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Resolve an output value to
async_graphql::Value
.source§fn qualified_type_name() -> String
fn qualified_type_name() -> String
Qualified typename.
source§impl PartialEq for ChainOwnership
impl PartialEq for ChainOwnership
source§fn eq(&self, other: &ChainOwnership) -> bool
fn eq(&self, other: &ChainOwnership) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ScalarType for ChainOwnership
impl ScalarType for ChainOwnership
source§impl Serialize for ChainOwnership
impl Serialize for ChainOwnership
impl Eq for ChainOwnership
impl StructuralPartialEq for ChainOwnership
Auto Trait Implementations§
impl RefUnwindSafe for ChainOwnership
impl Send for ChainOwnership
impl Sync for ChainOwnership
impl Unpin for ChainOwnership
impl UnwindSafe for ChainOwnership
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
§impl<T> CallHasher for T
impl<T> CallHasher for T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Upcastable for T
impl<T> Upcastable for T
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref
§fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
fn upcast_any_box(self: Box<T>) -> Box<dyn Any>
upcast boxed dyn