pub struct RestServer { /* private fields */ }Expand description
A server that serves a REST API for the bark Wallet
Implementations§
Source§impl RestServer
impl RestServer
Sourcepub async fn start(
config: &Config,
auth_token: Option<AuthToken>,
wallet: Option<ServerWallet>,
on_wallet_create: Option<Arc<OnWalletCreate>>,
on_wallet_delete: Option<Arc<OnWalletDelete>>,
) -> Result<Self>
pub async fn start( config: &Config, auth_token: Option<AuthToken>, wallet: Option<ServerWallet>, on_wallet_create: Option<Arc<OnWalletCreate>>, on_wallet_delete: Option<Arc<OnWalletDelete>>, ) -> Result<Self>
Start a new RestServer with the given config and an optional ServerWallet
If no wallet is provided, the server will reject any action.
If auth_secrets is non-empty, token-based authentication is
enforced on all /api/v1 routes.
Auto Trait Implementations§
impl Freeze for RestServer
impl RefUnwindSafe for RestServer
impl Send for RestServer
impl Sync for RestServer
impl Unpin for RestServer
impl UnsafeUnpin for RestServer
impl UnwindSafe for RestServer
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request