pub struct Server {
pub tenant: Did,
pub com_key: SecretKey,
pub private_database: Database,
pub public_database: Database,
pub dms_database: Database,
pub router: Box<dyn Router>,
pub did_resolver: Box<dyn DidResolver>,
}
Fields§
§tenant: Did
§com_key: SecretKey
§private_database: Database
§public_database: Database
§dms_database: Database
§router: Box<dyn Router>
§did_resolver: Box<dyn DidResolver>
Implementations§
Source§impl Server
impl Server
pub async fn new<KVS: KeyValueStore + 'static>( tenant: Did, com_key: SecretKey, data_path: Option<PathBuf>, did_resolver: Option<Box<dyn DidResolver>>, router: Option<Box<dyn Router>>, ) -> Result<Self, Error>
pub async fn start_server(self, port: u32) -> Result<Server, Error>
pub async fn process_packet( &mut self, packet: Packet, ) -> Result<DwnResponse, Error>
pub async fn process_request( &mut self, request: DwnRequest, ) -> Result<DwnResponse, Error>
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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> ⓘ
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