pub struct Config {
pub mode: Option<String>,
pub api_key: String,
pub api_url: String,
pub sailbox_api_url: String,
pub imagebuilder_url: String,
pub ingress_base: String,
pub ingress_scheme: IngressScheme,
}Expand description
Resolved SDK configuration: credentials plus the three service endpoints.
Usually produced from the environment and ~/.sail via
ClientBuilder or Client::from_env,
which also fill the derived fields consistently.
Debug redacts the API key, so a logged Config never leaks the
credential.
Fields§
§mode: Option<String>The environment mode these endpoints were resolved from, or None for
the default. Retained so a caller that rebuilds a config from an explicit
key can reselect the same environment (including its ingress scheme)
rather than fall back to the default.
api_key: StringBearer API key sent on every request (trimmed of surrounding whitespace).
api_url: StringBase URL of the public Sail REST API (no trailing path).
sailbox_api_url: StringBase URL of the Sailbox lifecycle/exec API.
imagebuilder_url: Stringhost:port endpoint that image builds are submitted to.
ingress_base: StringBase URL that listener URLs are built from when the server does not
return one, e.g. https://api.sailresearch.com.
ingress_scheme: IngressSchemeHow a listener’s URL is addressed under ingress_base.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env() -> Result<Config, SailError>
pub fn from_env() -> Result<Config, SailError>
Resolve a config from the environment, selecting the credential variable for the configured mode. Production and local retain the stored login fallback. The key is trimmed so one sourced with a trailing newline can’t produce a malformed bearer token.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request