pub struct Server { /* private fields */ }Expand description
HTTP server.
This HTTP server is the core of the functionality of maia-httpd. Most operations are performed as response to an HTTP request handled by this server.
Implementations§
Source§impl Server
impl Server
Sourcepub async fn new(
http_address: SocketAddr,
https_address: SocketAddr,
ssl_cert: Option<impl AsRef<Path>>,
ssl_key: Option<impl AsRef<Path>>,
ca_cert: Option<impl AsRef<Path>>,
state: AppState,
waterfall_sender: Sender<Bytes>,
) -> Result<Server>
pub async fn new( http_address: SocketAddr, https_address: SocketAddr, ssl_cert: Option<impl AsRef<Path>>, ssl_key: Option<impl AsRef<Path>>, ca_cert: Option<impl AsRef<Path>>, state: AppState, waterfall_sender: Sender<Bytes>, ) -> Result<Server>
Creates a new HTTP server.
The http_address parameter gives the address in which the server will
listen using HTTP. The https_address parameter gives the address in
which the server will listen using HTTPS. The ad9361 and ip_core
parameters give the server shared access to the AD9361 device and the
Maia SDR FPGA IP core. The spectrometer_samp_rate parameter gives
shared access to update the sample rate of the spectrometer. The
waiter_recorder is the interrupt waiter for the IQ recorder, which is
contolled by the HTTP server. The waterfall_sender is used to obtain
waterfall channel receivers for the websocket server.
After calling this function, the server needs to be run by calling
Server::run.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Server
impl !RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl !UnwindSafe for Server
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
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
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 more