pub struct AccessResponseBase {
pub response_base: ResponseBase,
pub credits: u64,
pub top_hash: String,
}Expand description
Definition. A base for RPC response types that support RPC payment.
Fields§
§response_base: ResponseBaseA flattened ResponseBase.
credits: u64If payment for RPC is enabled, the number of credits
available to the requesting client. Otherwise, 0.
top_hash: StringIf payment for RPC is enabled, the hash of the highest block in the chain. Otherwise, empty.
Implementations§
Source§impl AccessResponseBase
impl AccessResponseBase
Sourcepub const OK: Self
pub const OK: Self
Status::Ok and trusted Self.
This is the most common version of Self.
use cuprate_rpc_types::{misc::*, base::*};
assert_eq!(AccessResponseBase::OK, AccessResponseBase {
response_base: ResponseBase::OK,
credits: 0,
top_hash: "".into(),
});Sourcepub const OK_UNTRUSTED: Self
pub const OK_UNTRUSTED: Self
Same as Self::OK but with untrusted set to true.
use cuprate_rpc_types::{misc::*, base::*};
assert_eq!(AccessResponseBase::OK_UNTRUSTED, AccessResponseBase {
response_base: ResponseBase::OK_UNTRUSTED,
credits: 0,
top_hash: "".into(),
});Sourcepub const fn new(response_base: ResponseBase) -> Self
pub const fn new(response_base: ResponseBase) -> Self
Creates a new Self with default values.
Since RPC payment is semi-deprecated, Self::credits
and Self::top_hash will always be set to the default
values.
use cuprate_rpc_types::{misc::*, base::*};
let new = AccessResponseBase::new(ResponseBase::OK);
assert_eq!(new, AccessResponseBase {
response_base: ResponseBase::OK,
credits: 0,
top_hash: "".into(),
});Trait Implementations§
Source§impl Clone for AccessResponseBase
impl Clone for AccessResponseBase
Source§fn clone(&self) -> AccessResponseBase
fn clone(&self) -> AccessResponseBase
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessResponseBase
impl Debug for AccessResponseBase
Source§impl Default for AccessResponseBase
impl Default for AccessResponseBase
Source§fn default() -> AccessResponseBase
fn default() -> AccessResponseBase
Source§impl<'de> Deserialize<'de> for AccessResponseBase
Available on crate feature serde only.
impl<'de> Deserialize<'de> for AccessResponseBase
serde only.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>,
Source§impl EpeeObject for AccessResponseBase
impl EpeeObject for AccessResponseBase
impl Eq for AccessResponseBase
Source§impl Hash for AccessResponseBase
impl Hash for AccessResponseBase
Source§impl Ord for AccessResponseBase
impl Ord for AccessResponseBase
Source§fn cmp(&self, other: &AccessResponseBase) -> Ordering
fn cmp(&self, other: &AccessResponseBase) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AccessResponseBase
impl PartialEq for AccessResponseBase
Source§impl PartialOrd for AccessResponseBase
impl PartialOrd for AccessResponseBase
Source§impl Serialize for AccessResponseBase
Available on crate feature serde only.
impl Serialize for AccessResponseBase
serde only.impl StructuralPartialEq for AccessResponseBase
Auto Trait Implementations§
impl Freeze for AccessResponseBase
impl RefUnwindSafe for AccessResponseBase
impl Send for AccessResponseBase
impl Sync for AccessResponseBase
impl Unpin for AccessResponseBase
impl UnsafeUnpin for AccessResponseBase
impl UnwindSafe for AccessResponseBase
Blanket Implementations§
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> EpeeValue for Twhere
T: EpeeObject,
impl<T> EpeeValue for Twhere
T: EpeeObject,
const MARKER: Marker
fn read<B>(
r: &mut B,
marker: &Marker,
limits: EpeeValueLimits,
) -> Result<T, Error>where
B: Buf,
fn write<B>(self, w: &mut B) -> Result<(), Error>where
B: BufMut,
fn should_write(&self) -> bool
§fn epee_default_value() -> Option<Self>
fn epee_default_value() -> Option<Self>
§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<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<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 more§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: 64 bytes