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.
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