pub struct ServerBuilder { /* private fields */ }Expand description
Builder for creating a Commune server with customizable components.
Implementations§
Source§impl ServerBuilder
impl ServerBuilder
Sourcepub fn new() -> ServerBuilder
pub fn new() -> ServerBuilder
Creates a new ServerBuilder with default values.
Sourcepub fn with_peers(self, peers: Vec<Peer>) -> ServerBuilder
pub fn with_peers(self, peers: Vec<Peer>) -> ServerBuilder
Adds multiple peers to the server.
Sourcepub fn with_peer(self, peer: Peer) -> ServerBuilder
pub fn with_peer(self, peer: Peer) -> ServerBuilder
Adds a single peer to the server.
Sourcepub fn with_prompt(self, prompt: Prompt) -> ServerBuilder
pub fn with_prompt(self, prompt: Prompt) -> ServerBuilder
Adds a single prompt to the server.
Sourcepub fn with_prompts(self, prompts: Vec<Prompt>) -> ServerBuilder
pub fn with_prompts(self, prompts: Vec<Prompt>) -> ServerBuilder
Adds multiple prompts to the server.
Sourcepub fn with_resource(self, resource: Resource) -> ServerBuilder
pub fn with_resource(self, resource: Resource) -> ServerBuilder
Adds a single resource to the server.
Sourcepub fn with_resources(self, resources: Vec<Resource>) -> ServerBuilder
pub fn with_resources(self, resources: Vec<Resource>) -> ServerBuilder
Adds multiple resources to the server.
Sourcepub fn with_tool(self, tool: Tool) -> ServerBuilder
pub fn with_tool(self, tool: Tool) -> ServerBuilder
Adds a single tool to the server.
Sourcepub fn with_tools(self, tools: Vec<Tool>) -> ServerBuilder
pub fn with_tools(self, tools: Vec<Tool>) -> ServerBuilder
Adds multiple tools to the server.
Trait Implementations§
Source§impl Default for ServerBuilder
impl Default for ServerBuilder
Source§fn default() -> ServerBuilder
fn default() -> ServerBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerBuilder
impl !RefUnwindSafe for ServerBuilder
impl Send for ServerBuilder
impl Sync for ServerBuilder
impl Unpin for ServerBuilder
impl !UnwindSafe for ServerBuilder
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<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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.