struct GatewaySettings {
port: Option<u16>,
streak_count: Option<u32>,
streak_window_secs: Option<u64>,
no_reset_cooldown_secs: Option<u64>,
}Expand description
One [gateway] table. Unknown fields are rejected so a mistyped
key fails the load instead of being ignored.
Fields§
§port: Option<u16>The inference listener’s port. Fixed by default.
streak_count: Option<u32>How many consecutive 429s from one account fire a rotation.
streak_window_secs: Option<u64>The window the 429 streak is counted over, in seconds.
no_reset_cooldown_secs: Option<u64>The cooldown when no reset time is known, in seconds.
Implementations§
Source§impl GatewaySettings
impl GatewaySettings
Sourcefn resolved_port(&self, path: &Path) -> Result<u16, WorkspaceError>
fn resolved_port(&self, path: &Path) -> Result<u16, WorkspaceError>
The resolved port, refusing 0: the port is fixed by design, and a 0 here would ask the OS for an ephemeral port no child was ever told about.
Sourcefn resolved_rotation(
&self,
path: &Path,
) -> Result<RotationNumbers, WorkspaceError>
fn resolved_rotation( &self, path: &Path, ) -> Result<RotationNumbers, WorkspaceError>
The resolved rotation numbers, refusing 0 on any of them: each 0 would silently disable the mechanism it configures, which reads as a bug rather than a choice. A magnitude above u32 seconds is refused the same way - silently mapping it to the default is the substitution this refusal exists to prevent.
Trait Implementations§
Source§impl Debug for GatewaySettings
impl Debug for GatewaySettings
Source§impl<'de> Deserialize<'de> for GatewaySettings
impl<'de> Deserialize<'de> for GatewaySettings
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>,
Auto Trait Implementations§
impl Freeze for GatewaySettings
impl RefUnwindSafe for GatewaySettings
impl Send for GatewaySettings
impl Sync for GatewaySettings
impl Unpin for GatewaySettings
impl UnsafeUnpin for GatewaySettings
impl UnwindSafe for GatewaySettings
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
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
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§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