pub struct Ctx {
pub sdk: QuicknodeSdk,
pub out: OutputCtx,
pub global: GlobalArgs,
}Fields§
§sdk: QuicknodeSdk§out: OutputCtx§global: GlobalArgsImplementations§
Source§impl Ctx
impl Ctx
Sourcepub fn from_global(global: GlobalArgs) -> Result<Self, CliError>
pub fn from_global(global: GlobalArgs) -> Result<Self, CliError>
Construct the SDK + output ctx from global. Resolves the API key per
the documented precedence: flag > config file (--config-file path if
given, else the default). If neither supplies a key we return
CliError::NoApiKey — regular commands do not prompt; the user is
directed to qn auth login.
Sourcepub fn from_global_with_rpc_seed(
global: GlobalArgs,
seed: Option<CachedToken>,
config_endpoint_url: Option<String>,
) -> Result<(Self, String), CliError>
pub fn from_global_with_rpc_seed( global: GlobalArgs, seed: Option<CachedToken>, config_endpoint_url: Option<String>, ) -> Result<(Self, String), CliError>
Like from_global but for qn rpc: seeds the RPC
client’s token cache with seed (a JWT loaded from disk) and sets the
client-wide custom endpoint URL from config_endpoint_url (the
[rpc] endpoint_url config default). Also returns the resolved API key
so the caller can scope and write back the token cache.
Sourcepub fn from_global_keyless_payment(
global: GlobalArgs,
payment: PaymentConfig,
) -> Result<Self, CliError>
pub fn from_global_keyless_payment( global: GlobalArgs, payment: PaymentConfig, ) -> Result<Self, CliError>
Build a keyless SDK context for paid RPC calls.
Sourcepub fn from_global_keyless(global: GlobalArgs) -> Result<Self, CliError>
pub fn from_global_keyless(global: GlobalArgs) -> Result<Self, CliError>
Build a keyless SDK context for local-only commands.
Auto Trait Implementations§
impl !RefUnwindSafe for Ctx
impl !UnwindSafe for Ctx
impl Freeze for Ctx
impl Send for Ctx
impl Sync for Ctx
impl Unpin for Ctx
impl UnsafeUnpin for Ctx
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
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
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>
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 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>
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