Struct buildsrs_backend::Backend
source · pub struct Backend { /* private fields */ }
Expand description
Backend state.
This struct contains all shared state that is needed to implement the backend service.
Implementations§
source§impl Backend
impl Backend
sourcepub async fn handle_jobs(
&self,
websocket: WebSocket
) -> Result<(), WebSocketError>
pub async fn handle_jobs( &self, websocket: WebSocket ) -> Result<(), WebSocketError>
Handle jobs websocket connection.
source§impl Backend
impl Backend
sourcepub fn new(database: AnyMetadata, storage: AnyStorage) -> Self
pub fn new(database: AnyMetadata, storage: AnyStorage) -> Self
Create new backend state from a database connection and storage instance.
sourcepub fn with_frontend(self, frontend: SharedFiles) -> Self
pub fn with_frontend(self, frontend: SharedFiles) -> Self
Replace frontend files
sourcepub fn frontend(&self) -> &SharedFiles
pub fn frontend(&self) -> &SharedFiles
Frontend files
sourcepub fn database(&self) -> &AnyMetadata
pub fn database(&self) -> &AnyMetadata
Return a reference to the database.
sourcepub fn storage(&self) -> &AnyStorage
pub fn storage(&self) -> &AnyStorage
Return a reference to the storage.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Backend
impl Send for Backend
impl Sync for Backend
impl Unpin for Backend
impl !UnwindSafe for Backend
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>
Creates a shared type from an unshared type.