Struct PeekMut

Source
pub struct PeekMut<'a, T> { /* private fields */ }
๐Ÿ”ฌThis is a nightly-only experimental API. (vec_peek_mut)
Expand description

Structure wrapping a mutable reference to the last item in a Vec.

This struct is created by the peek_mut method on Vec. See its documentation for more.

Implementationsยง

Sourceยง

impl<'a, T> PeekMut<'a, T>

Source

pub fn pop(self) -> T

๐Ÿ”ฌThis is a nightly-only experimental API. (vec_peek_mut)

Removes the peeked value from the vector and returns it.

Trait Implementationsยง

Sourceยง

impl<T> Debug for PeekMut<'_, T>
where T: Debug,

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Sourceยง

impl<'a, T> Deref for PeekMut<'a, T>

Sourceยง

type Target = T

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &<PeekMut<'a, T> as Deref>::Target

Dereferences the value.
Sourceยง

impl<'a, T> DerefMut for PeekMut<'a, T>

Sourceยง

fn deref_mut(&mut self) -> &mut <PeekMut<'a, T> as Deref>::Target

Mutably dereferences the value.

Auto Trait Implementationsยง

ยง

impl<'a, T> Freeze for PeekMut<'a, T>

ยง

impl<'a, T> RefUnwindSafe for PeekMut<'a, T>
where T: RefUnwindSafe,

ยง

impl<'a, T> Send for PeekMut<'a, T>
where T: Send,

ยง

impl<'a, T> Sync for PeekMut<'a, T>
where T: Sync,

ยง

impl<'a, T> Unpin for PeekMut<'a, T>

ยง

impl<'a, T> !UnwindSafe for PeekMut<'a, T>

Blanket Implementationsยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> Instrument for T

Sourceยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Sourceยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Sourceยง

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Sourceยง

type Target = T

๐Ÿ”ฌThis is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Sourceยง

impl<S, T> ScoreLookUp for T
where S: ScoreLookUp, T: Deref<Target = S>,

Sourceยง

type ScoreParams = <S as ScoreLookUp>::ScoreParams

A configurable type which should contain various passed-in parameters for configuring the scorer, on a per-routefinding-call basis through to the scorer methods, which are used to determine the parameters for the suitability of channels for use.
Sourceยง

fn channel_penalty_msat( &self, candidate: &CandidateRouteHop<'_>, usage: ChannelUsage, score_params: &<T as ScoreLookUp>::ScoreParams, ) -> u64

Returns the fee in msats willing to be paid to avoid routing send_amt_msat through the given channel in the direction from source to target. Read more
Sourceยง

impl<S, T> ScoreUpdate for T
where S: ScoreUpdate, T: DerefMut<Target = S>,

Sourceยง

fn payment_path_failed( &mut self, path: &Path, short_channel_id: u64, duration_since_epoch: Duration, )

Handles updating channel penalties after failing to route through a channel.
Sourceยง

fn payment_path_successful( &mut self, path: &Path, duration_since_epoch: Duration, )

Handles updating channel penalties after successfully routing along a path.
Sourceยง

fn probe_failed( &mut self, path: &Path, short_channel_id: u64, duration_since_epoch: Duration, )

Handles updating channel penalties after a probe over the given path failed.
Sourceยง

fn probe_successful(&mut self, path: &Path, duration_since_epoch: Duration)

Handles updating channel penalties after a probe over the given path succeeded.
Sourceยง

fn time_passed(&mut self, duration_since_epoch: Duration)

Scorers may wish to reduce their certainty of channel liquidity information over time. Thus, this method is provided to allow scorers to observe the passage of time - the holder of this object should call this method regularly (generally via the lightning-background-processor crate).
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Sourceยง

fn vzip(self) -> V

Sourceยง

impl<T> WithSubscriber for T

Sourceยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Sourceยง

impl<T> Score for T