pub struct LocalServerBuilder { /* private fields */ }Expand description
Builder for the local deployment flavor: a fully in-memory, auth-off, single-process server, embeddable in-process.
All knobs are optional — LocalServer::builder().spawn().await boots the
default flavor (in-memory everything, loopback :8787, no auth, no seed).
Construct with LocalServer::builder.
Implementations§
Source§impl LocalServerBuilder
impl LocalServerBuilder
Sourcepub fn addr(self, addr: SocketAddr) -> Self
pub fn addr(self, addr: SocketAddr) -> Self
Bind on the given address instead of the default 127.0.0.1:8787.
Use port 0 for an ephemeral port (read the real one back from
LocalServer::addr after spawn).
Sourcepub fn seed_kb(self, seed: bool) -> Self
pub fn seed_kb(self, seed: bool) -> Self
Seed the knowledge base with the demo docs on boot (default false).
Handy for an embedded demo / smoke test with grounded answers.
Sourcepub fn config(self, config: ServerConfig) -> Self
pub fn config(self, config: ServerConfig) -> Self
Override the full ServerConfig (e.g. to point at a gateway / model).
The local flavor still forces in-memory storage and the caller’s bind addr regardless of what this config says — the storage/bind fields are overwritten — so the “no external services” guarantee always holds. Use this to set the gateway URL / key / model / limits for live turns.
Sourcepub async fn spawn(self) -> Result<LocalServer>
pub async fn spawn(self) -> Result<LocalServer>
Bind and spawn the server in a background task, returning a LocalServer
handle carrying the real bound address (resolved even for port 0)
and a graceful-shutdown switch.
§Errors
Returns an error if binding the TCP listener fails (e.g. the port is in use). Serving errors after a successful bind surface when the handle is awaited / shut down.
Trait Implementations§
Source§impl Clone for LocalServerBuilder
impl Clone for LocalServerBuilder
Source§fn clone(&self) -> LocalServerBuilder
fn clone(&self) -> LocalServerBuilder
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 LocalServerBuilder
impl Debug for LocalServerBuilder
Auto Trait Implementations§
impl Freeze for LocalServerBuilder
impl RefUnwindSafe for LocalServerBuilder
impl Send for LocalServerBuilder
impl Sync for LocalServerBuilder
impl Unpin for LocalServerBuilder
impl UnsafeUnpin for LocalServerBuilder
impl UnwindSafe for LocalServerBuilder
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§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