pub struct ServerConfig {
pub state_dir: PathBuf,
pub listen: SocketAddr,
pub octoprint: OctoPrintConfig,
pub safety: SafetyEnvelope,
pub harness: HarnessIdentity,
pub model: Option<ModelName>,
pub skill_path: Option<PathBuf>,
pub prompt_template_path: Option<PathBuf>,
pub ingress_answer_bound: Duration,
pub ingress_shared_secret: SharedSecret,
}Expand description
One running server’s validated configuration.
Every value here is one no later step has to re-examine, and where a
validated type for one already exists it is that type rather than the text
it was written as: the OctoPrint instance is the adapter’s own
configuration, which redacts the key it carries; the harness and the model
are the supervisor adapter’s own names; and the ingress secret is a value
neither rendering of which shows.
Fields§
§state_dir: PathBufWhere the store, the images and the sessions live.
listen: SocketAddrThe address the API and the ingress are served on.
octoprint: OctoPrintConfigEverything the printer adapter needs to reach the instance.
safety: SafetyEnvelopeThe operator’s safety envelope.
harness: HarnessIdentityThe harness identity turns run on.
model: Option<ModelName>The model turns are pinned to, when one is pinned.
skill_path: Option<PathBuf>The skill to send as every turn’s system prompt, when the operator supplied one.
prompt_template_path: Option<PathBuf>The prompt template one turn fills, when the operator supplied one.
ingress_answer_bound: DurationHow long the ingress may take to answer.
The shared secret every post to the ingress must carry.
Implementations§
Source§impl ServerConfig
impl ServerConfig
Sourcepub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
pub fn load(path: impl AsRef<Path>) -> Result<Self, ConfigError>
Read and validate the one configuration file this program takes.
§Errors
Returns ConfigError::Unreadable when the file is not there,
ConfigError::Unparsable when it is not this program’s configuration,
and ConfigError::Field naming the one field whose value cannot be
accepted. The two values only the machine can rule on — the OctoPrint
address and key — are ruled on by crate::Server::start, which is
where a printer exists to ask.
Sourcepub fn parse(text: &str, path: &Path) -> Result<Self, ConfigError>
pub fn parse(text: &str, path: &Path) -> Result<Self, ConfigError>
The same, over a document already read.
§Errors
The same as ServerConfig::load, less the unreadable file.
Sourcepub fn assets_dir(&self) -> PathBuf
pub fn assets_dir(&self) -> PathBuf
Where this server materializes the agent’s committed assets.
Trait Implementations§
Source§impl Clone for ServerConfig
impl Clone for ServerConfig
Source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ServerConfig
impl Debug for ServerConfig
Source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl Freeze for ServerConfig
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnsafeUnpin for ServerConfig
impl UnwindSafe for ServerConfig
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> 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> ⓘ
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