Struct GCHubRestServerBuilder
pub struct GCHubRestServerBuilder {
bind_addr: String,
port: u16,
serve_path: Option<PathBuf>,
log_reader_connection: Option<LogReaderConnection>,
config_db: GCSharedConfigDatabase,
rt_manager: GCSharedRuntimeManager,
ldap_config: Option<LdapConfigBuilder>,
default_user: Option<UserID>,
}Expand description
The main component that describes the REST API server. The server can be started in a different thread by calling the GCHubRestServerBuilder::run method. The open API specification can be generated by calling the generate_open_api_spec_json method.
Fields§
§bind_addr: String§port: u16§serve_path: Option<PathBuf>§log_reader_connection: Option<LogReaderConnection>§config_db: GCSharedConfigDatabase§rt_manager: GCSharedRuntimeManager§ldap_config: Option<LdapConfigBuilder>§default_user: Option<UserID>Implementations§
§impl GCHubRestServerBuilder
impl GCHubRestServerBuilder
pub fn new( rt_manager: GCSharedRuntimeManager, config_db: GCSharedConfigDatabase, ) -> Self
pub fn set_port(self, port: u16) -> Self
pub fn set_log_reader_connection( self, log_reader_connection: LogReaderConnection, ) -> Self
pub fn set_serve_directory(self, path: PathBuf) -> Self
pub fn set_bind_addr(self, bind_addr: &str) -> Self
pub fn set_disable_auth(self, user: UserID) -> Self
pub fn set_disable_auth(self, user: UserID) -> Self
Provides a default user for all routes, this will disable authentication and authorization
pub fn set_ldap(self, ldap_auth: LdapConfigBuilder) -> Self
pub async fn run(self) -> Result<(), GCHubRestServerError>
Auto Trait Implementations§
impl !Freeze for GCHubRestServerBuilder
impl !RefUnwindSafe for GCHubRestServerBuilder
impl Send for GCHubRestServerBuilder
impl Sync for GCHubRestServerBuilder
impl Unpin for GCHubRestServerBuilder
impl !UnwindSafe for GCHubRestServerBuilder
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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 more