Skip to main content

ServerConfig

Struct ServerConfig 

Source
pub struct ServerConfig {
    pub enabled: bool,
    pub port: u16,
    pub bind: IpAddr,
    pub tool_record_cap_kb: u64,
    pub first_frame_cap_kb: u64,
    pub more_page_cap_kb: u64,
    pub allowed_origins: Vec<String>,
}
Expand description

The [server] block of forge.toml: whether the socket’s listener starts with forge, where it binds, and how large a served page’s structured tool record may be.

On unless it is turned off, so a restart leaves the socket serving without a key being added first.

Fields§

§enabled: bool§port: u16§bind: IpAddr

Loopback by default: an address on a network interface is a deliberate line in forge.toml, never something on-by-default reaches.

§tool_record_cap_kb: u64

How large a frame’s tool_use_result may be in anything a client is served, in KB (#2374).

A record over it is reduced first, keeping only the keys a client draws (a mutation’s patch and outside-edit mark, a question’s answers and notes); it becomes an omitted marker only when that reduction is still over the cap. Every path to a client is bounded - a page, a more, the live stream and both repairs - while the transcript keeps the record whole and the visible tool-result block draws as always. 0 serves the records whole, for a reader whose changes carry patches beyond the default.

§first_frame_cap_kb: u64

How many bytes of conversation a session’s first snapshot carries, in KB.

The first snapshot is what a seat switch waits on, and twenty turns of a large conversation are megabytes: seconds over a network, from a frame a client spends milliseconds on locally. The newest turns are kept while they fit and the rest is paged through more as it always was, so nothing is dropped and the order does not move. 0 serves the page the turn count asks for, for a reader who would rather have the whole window in one frame.

§more_page_cap_kb: u64

How many bytes of conversation a more page carries, in KB.

A page past the first frame is unbounded by its turn count alone: the page contract is whole turns, so one large turn crossed whole and a more answer could be tens of megabytes. The newest whole turns are kept while they fit, the newest rides even when it alone is over, and the cursor names the history above the page as it always did - nothing is dropped and the walk above it still reaches every turn. 0 serves the page the turn count asks for.

§allowed_origins: Vec<String>

Extra browser origins allowed to open the socket, beside the shell’s own, the server’s own, and any page served on the user’s own machine - the localhost name or any loopback IP address, any port, http or https, in every build. A web client served from another address is one only the operator knows; an empty list allows none.

Trait Implementations§

Source§

impl Clone for ServerConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ServerConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ServerConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for ServerConfig

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more