pub struct SignwayServer {
pub port: u16,
pub secret_getter: Arc<dyn SecretGetter>,
pub on_request: Option<Arc<dyn OnRequest>>,
pub on_success: Option<Arc<dyn OnSuccess>>,
/* private fields */
}
Fields§
§port: u16
§secret_getter: Arc<dyn SecretGetter>
§on_request: Option<Arc<dyn OnRequest>>
§on_success: Option<Arc<dyn OnSuccess>>
Implementations§
Source§impl SignwayServer
impl SignwayServer
pub fn from_env(secret_getter: impl SecretGetter + 'static) -> SignwayServer
pub fn from_port( secret_getter: impl SecretGetter + 'static, port: u16, ) -> SignwayServer
pub fn on_success(self, callback: impl OnSuccess + 'static) -> Self
pub fn on_request(self, callback: impl OnRequest + 'static) -> Self
pub fn access_control_allow_origin(self, value: &str) -> Result<Self>
pub fn access_control_allow_methods(self, value: &str) -> Result<Self>
pub fn access_control_allow_headers(self, value: &str) -> Result<Self>
Sourcepub async fn start(&self) -> Result<()>
pub async fn start(&self) -> Result<()>
Starts the server by maintaining a reference count in each request handle. This will grant that the memory occupied by the server will be freed after this function has finished and all the requests have already been handled. Use this function if your application will continue running after stopping the server. Calling this function has a small runtime cost for maintaining the reference counting.
Source§impl SignwayServer
impl SignwayServer
pub fn subscribe_to_monitoring(&self) -> Receiver<BytesTransferredInfo>
Trait Implementations§
Source§impl Clone for SignwayServer
impl Clone for SignwayServer
Source§fn clone(&self) -> SignwayServer
fn clone(&self) -> SignwayServer
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl !Freeze for SignwayServer
impl !RefUnwindSafe for SignwayServer
impl Send for SignwayServer
impl Sync for SignwayServer
impl Unpin for SignwayServer
impl !UnwindSafe for SignwayServer
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