Struct noble_staking::Module [−][src]
Implementations
impl<T: Config + 'static> Module<T>
[src]
pub fn history_depth() -> u32
[src]
Number of eras to keep in history.
Information is kept for eras in [current_era - history_depth; current_era]
.
Must be more than the number of eras delayed by session otherwise. I.e. active era must
always be in history. I.e. active_era > current_era - history_depth
must be
guaranteed.
pub fn validator_count() -> u32
[src]
The ideal number of staking participants.
pub fn minimum_validator_count() -> u32
[src]
Minimum number of staking participants before emergency conditions are imposed.
pub fn invulnerables() -> Vec<T::AccountId>
[src]
Any validators that may never be slashed or forcibly kicked. It’s a Vec since they’re easy to initialize and the performance hit is minimal (we expect no more than four invulnerables) and restricted to testnets.
pub fn bonded<K: EncodeLike<T::AccountId>>(key: K) -> Option<T::AccountId>
[src]
Map from all locked “stash” accounts to the controller account.
pub fn ledger<K: EncodeLike<T::AccountId>>(
key: K
) -> Option<StakingLedger<T::AccountId, BalanceOf<T>>>
[src]
key: K
) -> Option<StakingLedger<T::AccountId, BalanceOf<T>>>
Map from all (unlocked) “controller” accounts to the info regarding the staking.
pub fn payee<K: EncodeLike<T::AccountId>>(
key: K
) -> RewardDestination<T::AccountId>
[src]
key: K
) -> RewardDestination<T::AccountId>
Where the reward payment should be made. Keyed by stash.
pub fn validators<K: EncodeLike<T::AccountId>>(key: K) -> ValidatorPrefs
[src]
The map from (wannabe) validator stash key to the preferences of that validator.
pub fn nominators<K: EncodeLike<T::AccountId>>(
key: K
) -> Option<Nominations<T::AccountId>>
[src]
key: K
) -> Option<Nominations<T::AccountId>>
The map from nominator stash key to the set of stash keys of all validators to nominate.
pub fn current_era() -> Option<EraIndex>
[src]
The current era index.
This is the latest planned era, depending on how the Session noble queues the validator set, it might be active or not.
pub fn active_era() -> Option<ActiveEraInfo>
[src]
The active era information, it holds index and start.
The active era is the era being currently rewarded. Validator set of this era must be
equal to SessionInterface::validators
.
pub fn eras_start_session_index<K: EncodeLike<EraIndex>>(
key: K
) -> Option<SessionIndex>
[src]
key: K
) -> Option<SessionIndex>
The session index at which the era start for the last HISTORY_DEPTH
eras.
Note: This tracks the starting session (i.e. session index when era start being active)
for the eras in [CurrentEra - HISTORY_DEPTH, CurrentEra]
.
pub fn eras_stakers<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> Exposure<T::AccountId, BalanceOf<T>> where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
[src]
k1: KArg1,
k2: KArg2
) -> Exposure<T::AccountId, BalanceOf<T>> where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
pub fn eras_stakers_clipped<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> Exposure<T::AccountId, BalanceOf<T>> where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
[src]
k1: KArg1,
k2: KArg2
) -> Exposure<T::AccountId, BalanceOf<T>> where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
pub fn eras_validator_prefs<KArg1, KArg2>(
k1: KArg1,
k2: KArg2
) -> ValidatorPrefs where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
[src]
k1: KArg1,
k2: KArg2
) -> ValidatorPrefs where
KArg1: EncodeLike<EraIndex>,
KArg2: EncodeLike<T::AccountId>,
pub fn eras_validator_reward<K: EncodeLike<EraIndex>>(
key: K
) -> Option<BalanceOf<T>>
[src]
key: K
) -> Option<BalanceOf<T>>
The total validator era payout for the last HISTORY_DEPTH
eras.
Eras that haven’t finished yet or has been removed doesn’t have reward.
pub fn eras_reward_points<K: EncodeLike<EraIndex>>(
key: K
) -> EraRewardPoints<T::AccountId>
[src]
key: K
) -> EraRewardPoints<T::AccountId>
Rewards for the last HISTORY_DEPTH
eras.
If reward hasn’t been set or has been removed then 0 reward is returned.
pub fn eras_total_stake<K: EncodeLike<EraIndex>>(key: K) -> BalanceOf<T>
[src]
The total amount staked for the last HISTORY_DEPTH
eras.
If total hasn’t been set or has been removed then 0 stake is returned.
pub fn force_era() -> Forcing
[src]
Mode of era forcing.
pub fn slash_reward_fraction() -> Perbill
[src]
The percentage of the slash that is distributed to reporters.
The rest of the slashed value is handled by the Slash
.
pub fn canceled_payout() -> BalanceOf<T>
[src]
The amount of currency given to reporters of a slash event which was canceled by extraordinary circumstances (e.g. governance).
pub fn slashing_spans<K: EncodeLike<T::AccountId>>(
key: K
) -> Option<SlashingSpans>
[src]
key: K
) -> Option<SlashingSpans>
Slashing spans for stash accounts.
pub fn snapshot_validators() -> Option<Vec<T::AccountId>>
[src]
Snapshot of validators at the beginning of the current election window. This should only
have a value when EraElectionStatus
== ElectionStatus::Open(_)
.
pub fn snapshot_nominators() -> Option<Vec<T::AccountId>>
[src]
Snapshot of nominators at the beginning of the current election window. This should only
have a value when EraElectionStatus
== ElectionStatus::Open(_)
.
pub fn queued_elected() -> Option<ElectionResult<T::AccountId, BalanceOf<T>>>
[src]
The next validator set. At the end of an era, if this is available (potentially from the result of an offchain worker), it is immediately used. Otherwise, the on-chain election is executed.
pub fn queued_score() -> Option<ElectionScore>
[src]
The score of the current QueuedElected
.
pub fn era_election_status() -> ElectionStatus<T::BlockNumber>
[src]
Flag to control the execution of the offchain election. When Open(_)
, we accept
solutions to be submitted.
pub fn is_current_session_final() -> bool
[src]
True if the current planned session is final. Note that this does not take era forcing into account.
impl<T: Config> Module<T>
[src]
Can also be called using Call
.
pub fn bond(
origin: T::Origin,
controller: <T::Lookup as StaticLookup>::Source,
value: BalanceOf<T>,
payee: RewardDestination<T::AccountId>
) -> DispatchResult
[src]
origin: T::Origin,
controller: <T::Lookup as StaticLookup>::Source,
value: BalanceOf<T>,
payee: RewardDestination<T::AccountId>
) -> DispatchResult
Take the origin account as a stash and lock up value
of its balance. controller
will
be the account that controls it.
value
must be more than the minimum_balance
specified by T::Currency
.
The dispatch origin for this call must be Signed by the stash account.
Emits Bonded
.
- Independent of the arguments. Moderate complexity.
- O(1).
- Three extra DB entries.
NOTE: Two of the storage writes (Self::bonded
, Self::payee
) are never cleaned
unless the origin
falls below existential deposit and gets removed as dust.
Weight: O(1) DB Weight:
- Read: Bonded, Ledger, [Origin Account], Current Era, History Depth, Locks
- Write: Bonded, Payee, [Origin Account], Locks, Ledger
NOTE: Calling this function will bypass origin filters.
pub fn validate(origin: T::Origin, prefs: ValidatorPrefs) -> DispatchResult
[src]
Declare the desire to validate for the origin controller.
Effects will be felt at the beginning of the next era.
The dispatch origin for this call must be Signed by the controller, not the stash.
And, it can be only called when EraElectionStatus
is Closed
.
- Independent of the arguments. Insignificant complexity.
- Contains a limited number of reads.
- Writes are limited to the
origin
account key.
Weight: O(1) DB Weight:
- Read: Era Election Status, Ledger
- Write: Nominators, Validators
NOTE: Calling this function will bypass origin filters.
pub fn nominate(
origin: T::Origin,
targets: Vec<<T::Lookup as StaticLookup>::Source>
) -> DispatchResult
[src]
origin: T::Origin,
targets: Vec<<T::Lookup as StaticLookup>::Source>
) -> DispatchResult
Declare the desire to nominate targets
for the origin controller.
Effects will be felt at the beginning of the next era. This can only be called when
EraElectionStatus
is Closed
.
The dispatch origin for this call must be Signed by the controller, not the stash.
And, it can be only called when EraElectionStatus
is Closed
.
- The transaction’s complexity is proportional to the size of
targets
(N) which is capped at CompactAssignments::LIMIT (MAX_NOMINATIONS). - Both the reads and writes follow a similar pattern.
Weight: O(N) where N is the number of targets DB Weight:
- Reads: Era Election Status, Ledger, Current Era
- Writes: Validators, Nominators
NOTE: Calling this function will bypass origin filters.
pub fn submit_election_solution(
origin: T::Origin,
winners: Vec<ValidatorIndex>,
compact: CompactAssignments,
score: ElectionScore,
era: EraIndex,
size: ElectionSize
) -> DispatchResultWithPostInfo
[src]
origin: T::Origin,
winners: Vec<ValidatorIndex>,
compact: CompactAssignments,
score: ElectionScore,
era: EraIndex,
size: ElectionSize
) -> DispatchResultWithPostInfo
Submit an election result to the chain. If the solution:
- is valid.
- has a better score than a potentially existing solution on chain.
then, it will be put on chain.
A solution consists of two pieces of data:
winners
: a flat vector of all the winners of the round.assignments
: the compact version of an assignment vector that encodes the edge weights.
Both of which may be computed using phragmen, or any other algorithm.
Additionally, the submitter must provide:
- The
score
that they claim their solution has.
Both validators and nominators will be represented by indices in the solution. The
indices should respect the corresponding types (ValidatorIndex
and
NominatorIndex
). Moreover, they should be valid when used to index into
SnapshotValidators
and SnapshotNominators
. Any invalid index will cause the
solution to be rejected. These two storage items are set during the election window and
may be used to determine the indices.
A solution is valid if:
- It is submitted when
EraElectionStatus
isOpen
. - Its claimed score is equal to the score computed on-chain.
- Presents the correct number of winners.
- All indexes must be value according to the snapshot vectors. All edge values must also be correct and should not overflow the granularity of the ratio type (i.e. 256 or billion).
- For each edge, all targets are actually nominated by the voter.
- Has correct self-votes.
A solutions score is consisted of 3 parameters:
min { support.total }
for each support of a winner. This value should be maximized.sum { support.total }
for each support of a winner. This value should be minimized.sum { support.total^2 }
for each support of a winner. This value should be minimized (to ensure less variance)
The transaction is assumed to be the longest path, a better solution.
- Initial solution is almost the same.
- Worse solution is retraced in pre-dispatch-checks which sets its own weight.
NOTE: Calling this function will bypass origin filters.
pub fn submit_election_solution_unsigned(
origin: T::Origin,
winners: Vec<ValidatorIndex>,
compact: CompactAssignments,
score: ElectionScore,
era: EraIndex,
size: ElectionSize
) -> DispatchResultWithPostInfo
[src]
origin: T::Origin,
winners: Vec<ValidatorIndex>,
compact: CompactAssignments,
score: ElectionScore,
era: EraIndex,
size: ElectionSize
) -> DispatchResultWithPostInfo
Unsigned version of submit_election_solution
.
Note that this must pass the [ValidateUnsigned
] check which only allows transactions
from the local node to be included. In other words, only the block author can include a
transaction in the block.
See [submit_election_solution
].
NOTE: Calling this function will bypass origin filters.
pub fn kick(
origin: T::Origin,
who: Vec<<T::Lookup as StaticLookup>::Source>
) -> DispatchResult
[src]
origin: T::Origin,
who: Vec<<T::Lookup as StaticLookup>::Source>
) -> DispatchResult
Remove the given nominations from the calling validator.
Effects will be felt at the beginning of the next era.
The dispatch origin for this call must be Signed by the controller, not the stash.
And, it can be only called when EraElectionStatus
is Closed
. The controller
account should represent a validator.
who
: A list of nominator stash accounts who are nominating this validator which should no longer be nominating this validator.
Note: Making this call only makes sense if you first set the validator preferences to block any further nominations.
NOTE: Calling this function will bypass origin filters.
impl<T: Config> Module<T>
[src]
pub fn slashable_balance_of(stash: &T::AccountId) -> BalanceOf<T>
[src]
The total balance that can be slashed from a stash account as of right now.
pub fn slashable_balance_of_vote_weight(
stash: &T::AccountId,
issuance: BalanceOf<T>
) -> VoteWeight
[src]
stash: &T::AccountId,
issuance: BalanceOf<T>
) -> VoteWeight
Internal impl of Self::slashable_balance_of
that returns VoteWeight
.
pub fn slashable_balance_of_fn() -> Box<dyn Fn(&T::AccountId) -> VoteWeight>
[src]
Returns a closure around slashable_balance_of_vote_weight
that can be passed around.
This prevents call sites from repeatedly requesting total_issuance
from backend. But it is
important to be only used while the total issuance is not changing.
pub fn create_stakers_snapshot() -> (bool, Weight)
[src]
Dump the list of validators and nominators into vectors and keep them on-chain.
This data is used to efficiently evaluate election results. returns true
if the operation
is successful.
pub fn pre_dispatch_checks(
score: ElectionScore,
era: EraIndex
) -> DispatchResultWithPostInfo
[src]
score: ElectionScore,
era: EraIndex
) -> DispatchResultWithPostInfo
Basic and cheap checks that we perform in validate unsigned, and in the execution.
State reads: ElectionState, CurrentEr, QueuedScore.
This function does weight refund in case of errors, which is based upon the fact that it is called at the very beginning of the call site’s function.
pub fn check_and_replace_solution(
winners: Vec<ValidatorIndex>,
compact_assignments: CompactAssignments,
compute: ElectionCompute,
claimed_score: ElectionScore,
era: EraIndex,
election_size: ElectionSize
) -> DispatchResultWithPostInfo
[src]
winners: Vec<ValidatorIndex>,
compact_assignments: CompactAssignments,
compute: ElectionCompute,
claimed_score: ElectionScore,
era: EraIndex,
election_size: ElectionSize
) -> DispatchResultWithPostInfo
Checks a given solution and if correct and improved, writes it on chain as the queued result of the next round. This may be called by both a signed and an unsigned transaction.
pub fn do_on_chain_phragmen(
) -> Option<ElectionResult<T::AccountId, BalanceOf<T>>>
[src]
) -> Option<ElectionResult<T::AccountId, BalanceOf<T>>>
Execute election and return the new results. The edge weights are processed into support values.
This is basically a wrapper around Self::do_phragmen
which translates
PrimitiveElectionResult
into ElectionResult
.
No storage item is updated.
pub fn do_phragmen<Accuracy: PerThing128>(
iterations: usize
) -> Option<PrimitiveElectionResult<T::AccountId, Accuracy>>
[src]
iterations: usize
) -> Option<PrimitiveElectionResult<T::AccountId, Accuracy>>
Execute phragmen election and return the new results. No post-processing is applied and the raw edge weights are returned.
Self votes are added and nominations before the most recent slashing span are ignored.
No storage item is updated.
pub fn reward_by_ids(
validators_points: impl IntoIterator<Item = (T::AccountId, u32)>
)
[src]
validators_points: impl IntoIterator<Item = (T::AccountId, u32)>
)
Add reward points to validators using their stash account ID.
Validators are keyed by stash account ID and must be in the current elected set.
For each element in the iterator the given number of points in u32 is added to the validator, thus duplicates are handled.
At the end of the era each the total payout will be distributed among validator relatively to their points.
COMPLEXITY: Complexity is number_of_validator_to_reward x current_elected_len
.
If you need to reward lots of validator consider using reward_by_indices
.
Trait Implementations
impl<T: Config> Callable<T> for Module<T>
[src]
impl<T: Clone + Config> Clone for Module<T>
[src]
impl<T: Copy + Config> Copy for Module<T>
[src]
impl<T: Config> Debug for Module<T> where
T: Debug,
[src]
T: Debug,
impl<T: Eq + Config> Eq for Module<T>
[src]
impl<T> EventHandler<<T as Config>::AccountId, <T as Config>::BlockNumber> for Module<T> where
T: Config + Config + Config,
[src]
T: Config + Config + Config,
Add reward points to block authors:
- 20 points to the block producer for producing a (non-uncle) block in the relay chain,
- 2 points to the block producer for each reference to a previously unreferenced uncle, and
- 1 point to the producer of each referenced uncle block.
fn note_author(author: T::AccountId)
[src]
fn note_uncle(author: T::AccountId, _age: T::BlockNumber)
[src]
impl<T: Config> GetNobleVersion for Module<T>
[src]
fn current_version() -> NobleVersion
[src]
fn storage_version() -> Option<NobleVersion>
[src]
impl<T: Config> IntegrityTest for Module<T>
[src]
fn integrity_test()
[src]
impl<T: Config> ModuleErrorMetadata for Module<T>
[src]
fn metadata() -> &'static [ErrorMetadata]
[src]
impl<T: Config + Config> OffchainWorker<<T as Config>::BlockNumber> for Module<T>
[src]
fn offchain_worker(now: T::BlockNumber)
[src]
impl<T: Config + Config> OnFinalize<<T as Config>::BlockNumber> for Module<T>
[src]
fn on_finalize(_block_number_not_used: <T as Config>::BlockNumber)
[src]
impl<T: Config> OnGenesis for Module<T>
[src]
fn on_genesis()
[src]
impl<T: Config + Config> OnInitialize<<T as Config>::BlockNumber> for Module<T>
[src]
fn on_initialize(now: T::BlockNumber) -> Weight
[src]
impl<T: Config> OnOffenceHandler<<T as Config>::AccountId, (<T as Config>::ValidatorId, <T as Config>::FullIdentification), u64> for Module<T> where
T: Config<ValidatorId = <T as Config>::AccountId>,
T: Config<FullIdentification = Exposure<<T as Config>::AccountId, BalanceOf<T>>, FullIdentificationOf = ExposureOf<T>>,
T::SessionHandler: SessionHandler<<T as Config>::AccountId>,
T::SessionManager: SessionManager<<T as Config>::AccountId>,
T::ValidatorIdOf: Convert<<T as Config>::AccountId, Option<<T as Config>::AccountId>>,
[src]
T: Config<ValidatorId = <T as Config>::AccountId>,
T: Config<FullIdentification = Exposure<<T as Config>::AccountId, BalanceOf<T>>, FullIdentificationOf = ExposureOf<T>>,
T::SessionHandler: SessionHandler<<T as Config>::AccountId>,
T::SessionManager: SessionManager<<T as Config>::AccountId>,
T::ValidatorIdOf: Convert<<T as Config>::AccountId, Option<<T as Config>::AccountId>>,
This is intended to be used with FilterHistoricalOffences
.
fn on_offence(
offenders: &[OffenceDetails<T::AccountId, IdentificationTuple<T>>],
slash_fraction: &[Perbill],
slash_session: SessionIndex
) -> Result<Weight, ()>
[src]
offenders: &[OffenceDetails<T::AccountId, IdentificationTuple<T>>],
slash_fraction: &[Perbill],
slash_session: SessionIndex
) -> Result<Weight, ()>
fn can_report() -> bool
[src]
impl<T: Config> OnRuntimeUpgrade for Module<T>
[src]
fn on_runtime_upgrade() -> Weight
[src]
impl<T: PartialEq + Config> PartialEq<Module<T>> for Module<T>
[src]
impl<T: Config> SessionManager<<T as Config>::AccountId, Exposure<<T as Config>::AccountId, <<T as Config>::Currency as Currency<<T as Config>::AccountId>>::Balance>> for Module<T>
[src]
fn new_session(
new_index: SessionIndex
) -> Option<Vec<(T::AccountId, Exposure<T::AccountId, BalanceOf<T>>)>>
[src]
new_index: SessionIndex
) -> Option<Vec<(T::AccountId, Exposure<T::AccountId, BalanceOf<T>>)>>
fn start_session(start_index: SessionIndex)
[src]
fn end_session(end_index: SessionIndex)
[src]
impl<T: Config> SessionManager<<T as Config>::AccountId> for Module<T>
[src]
In this implementation new_session(session)
must be called before end_session(session-1)
i.e. the new session must be planned before the ending of the previous session.
Once the first new_session is planned, all session must start and then end in order, though some session can lag in between the newest session planned and the latest session started.
fn new_session(new_index: SessionIndex) -> Option<Vec<T::AccountId>>
[src]
fn start_session(start_index: SessionIndex)
[src]
fn end_session(end_index: SessionIndex)
[src]
impl<T: Config> StructuralEq for Module<T>
[src]
impl<T: Config> StructuralPartialEq for Module<T>
[src]
impl<T: Config> ValidateUnsigned for Module<T>
[src]
type Call = Call<T>
The call to validate
fn validate_unsigned(
source: TransactionSource,
call: &Self::Call
) -> TransactionValidity
[src]
source: TransactionSource,
call: &Self::Call
) -> TransactionValidity
fn pre_dispatch(call: &Self::Call) -> Result<(), TransactionValidityError>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Module<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Module<T> where
T: Send,
T: Send,
impl<T> Sync for Module<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Module<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Module<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CheckedConversion for T
[src]
pub fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
[src]
Self: TryFrom<T>,
pub fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
[src]
Self: TryInto<T>,
impl<T> Downcast for T where
T: Any,
T: Any,
pub fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
pub fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
pub fn as_any(&self) -> &(dyn Any + 'static)
pub fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
impl<T> DowncastSync for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IsType<T> for T
[src]
pub fn from_ref(t: &T) -> &T
[src]
pub fn into_ref(&self) -> &T
[src]
pub fn from_mut(t: &mut T) -> &mut T
[src]
pub fn into_mut(&mut self) -> &mut T
[src]
impl<T, Outer> IsWrappedBy<Outer> for T where
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
Outer: AsRef<T> + AsMut<T> + From<T>,
pub fn from_ref(outer: &Outer) -> &T
Get a reference to the inner from the outer.
pub fn from_mut(outer: &mut Outer) -> &mut T
Get a mutable reference to the inner from the outer.
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Member for T where
T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone,
[src]
T: 'static + Send + Sync + Debug + Eq + PartialEq<T> + Clone,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> SaturatedConversion for T
pub fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Self: UniqueSaturatedFrom<T>,
pub fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Self: UniqueSaturatedInto<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
T: UncheckedFrom<S>,
pub fn unchecked_into(self) -> T
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
T: Bounded,
S: TryInto<T>,
pub fn unique_saturated_into(self) -> T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,