Enum HeadersDirection
pub enum HeadersDirection {
Falling,
Rising,
}Expand description
Represents the direction for a headers request depending on the reverse field of the request.
The response must contain a number of block headers, of rising number when reverse is 0, falling when 1
Ref: https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockheaders-0x03
HeadersDirection::Rising block numbers for reverse == 0 == false
HeadersDirection::Falling block numbers for reverse == 1 == true
See also https://github.com/ethereum/devp2p/blob/master/caps/eth.md#getblockheaders-0x03
Variants§
Implementations§
§impl HeadersDirection
impl HeadersDirection
pub const fn is_falling(&self) -> bool
pub const fn is_falling(&self) -> bool
Returns true for falling block numbers
pub const fn new(reverse: bool) -> HeadersDirection
pub const fn new(reverse: bool) -> HeadersDirection
Converts the bool into a direction.
Returns:
HeadersDirection::Rising block numbers for reverse == 0 == false
HeadersDirection::Falling block numbers for reverse == 1 == true
Trait Implementations§
§impl<'arbitrary> Arbitrary<'arbitrary> for HeadersDirection
impl<'arbitrary> Arbitrary<'arbitrary> for HeadersDirection
§fn arbitrary(
u: &mut Unstructured<'arbitrary>,
) -> Result<HeadersDirection, Error>
fn arbitrary( u: &mut Unstructured<'arbitrary>, ) -> Result<HeadersDirection, Error>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<HeadersDirection, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<HeadersDirection, Error>
Self from the entirety of the given
unstructured data. Read more§impl Clone for HeadersDirection
impl Clone for HeadersDirection
§fn clone(&self) -> HeadersDirection
fn clone(&self) -> HeadersDirection
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for HeadersDirection
§impl Debug for HeadersDirection
impl Debug for HeadersDirection
§impl Decodable for HeadersDirection
impl Decodable for HeadersDirection
§fn decode(buf: &mut &[u8]) -> Result<HeadersDirection, Error>
fn decode(buf: &mut &[u8]) -> Result<HeadersDirection, Error>
buf must be advanced past
the decoded object.§impl Default for HeadersDirection
impl Default for HeadersDirection
§fn default() -> HeadersDirection
fn default() -> HeadersDirection
§impl<'de> Deserialize<'de> for HeadersDirection
impl<'de> Deserialize<'de> for HeadersDirection
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HeadersDirection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HeadersDirection, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Encodable for HeadersDirection
impl Encodable for HeadersDirection
impl Eq for HeadersDirection
§impl From<bool> for HeadersDirection
impl From<bool> for HeadersDirection
§fn from(reverse: bool) -> HeadersDirection
fn from(reverse: bool) -> HeadersDirection
§impl Hash for HeadersDirection
impl Hash for HeadersDirection
§impl PartialEq for HeadersDirection
impl PartialEq for HeadersDirection
§impl Serialize for HeadersDirection
impl Serialize for HeadersDirection
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for HeadersDirection
Auto Trait Implementations§
impl Freeze for HeadersDirection
impl RefUnwindSafe for HeadersDirection
impl Send for HeadersDirection
impl Sync for HeadersDirection
impl Unpin for HeadersDirection
impl UnsafeUnpin for HeadersDirection
impl UnwindSafe for HeadersDirection
Blanket Implementations§
impl<A> ArbInterop for A
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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 moreimpl<T> MaybeDebug for Twhere
T: Debug,
impl<T> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 1 byte
Size for each variant:
Falling: 0 bytesRising: 0 bytes