pub struct ServerBuilder<S: State = Empty> { /* private fields */ }
Expand description
Use builder syntax to set the inputs and finish with build()
.
Implementations§
Source§impl<S: State> ServerBuilder<S>
impl<S: State> ServerBuilder<S>
Sourcepub fn build(self) -> Serverwhere
S: IsComplete,
pub fn build(self) -> Serverwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn url(self, value: impl Into<String>) -> ServerBuilder<SetUrl<S>>where
S::Url: IsUnset,
pub fn url(self, value: impl Into<String>) -> ServerBuilder<SetUrl<S>>where
S::Url: IsUnset,
Required.
Target url of the Server
. It can be valid http url or relative path.
Url also supports variable substitution with {variable}
syntax. The substitutions
then can be configured with Server::variables
map.
Sourcepub fn description(
self,
value: impl Into<String>,
) -> ServerBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn description(
self,
value: impl Into<String>,
) -> ServerBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ServerBuilder<SetDescription<S>>where
S::Description: IsUnset,
pub fn maybe_description(
self,
value: Option<impl Into<String>>,
) -> ServerBuilder<SetDescription<S>>where
S::Description: IsUnset,
Sourcepub fn extensions(
self,
value: impl Into<Extensions>,
) -> ServerBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn extensions(
self,
value: impl Into<Extensions>,
) -> ServerBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Sourcepub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ServerBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
pub fn maybe_extensions(
self,
value: Option<impl Into<Extensions>>,
) -> ServerBuilder<SetExtensions<S>>where
S::Extensions: IsUnset,
Source§impl<S: State> ServerBuilder<S>
impl<S: State> ServerBuilder<S>
Sourcepub fn parameter(
self,
name: impl Into<String>,
variable: impl Into<ServerVariable>,
) -> Self
pub fn parameter( self, name: impl Into<String>, variable: impl Into<ServerVariable>, ) -> Self
Add parameter to Server
which is used to substitute values in Server::url
.
name
Defines name of the parameter which is being substituted within the url. If url has{username}
substitution then the name should beusername
.parameter
UseServerVariableBuilder
to define how the parameter is being substituted within the url.
Auto Trait Implementations§
impl<S> Freeze for ServerBuilder<S>
impl<S> RefUnwindSafe for ServerBuilder<S>
impl<S> Send for ServerBuilder<S>
impl<S> Sync for ServerBuilder<S>
impl<S> Unpin for ServerBuilder<S>
impl<S> UnwindSafe for ServerBuilder<S>
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