pub struct Config {
pub upstream: Upstream,
pub oauth: OAuth,
pub translation: Option<Translation>,
/* private fields */
}Expand description
Top-level stoat configuration, deserialized from a TOML file.
Fields§
§upstream: UpstreamUpstream API to proxy requests to.
oauth: OAuthOAuth PKCE configuration.
translation: Option<Translation>Request transformations applied to every proxied request.
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_toml(s: &str) -> Result<Self, Error>
pub fn from_toml(s: &str) -> Result<Self, Error>
Deserialize a Config from a TOML string.
URL fields are validated during deserialization — invalid URLs will
produce an error. The listen address is validated as a
SocketAddr.
§Errors
Returns a toml::de::Error if the input is not valid TOML, does
not match the expected schema, or contains invalid URLs or addresses.
Sourcepub fn listen_address(&self) -> SocketAddr
pub fn listen_address(&self) -> SocketAddr
The listen address, falling back to the default if not configured.
Sourcepub fn token_file_path(&self) -> &str
pub fn token_file_path(&self) -> &str
The token file path, falling back to the default if not configured.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Config
impl StructuralPartialEq for Config
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
Mutably borrows from an owned value. Read more
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.