pub struct Datasource {
pub name: String,
pub backend: Arc<dyn DatabaseBackend>,
pub dialect: Arc<dyn SqlDialect>,
pub config: AppConfig,
pub version: DbVersion,
}Expand description
A single database datasource with its backend, dialect, config, and version.
Fields§
§name: StringProfile name used for Accept-Profile / Content-Profile routing.
backend: Arc<dyn DatabaseBackend>§dialect: Arc<dyn SqlDialect>§config: AppConfig§version: DbVersionImplementations§
Source§impl Datasource
impl Datasource
Sourcepub fn new(
name: impl Into<String>,
backend: Arc<dyn DatabaseBackend>,
dialect: Arc<dyn SqlDialect>,
config: AppConfig,
version: DbVersion,
) -> Self
pub fn new( name: impl Into<String>, backend: Arc<dyn DatabaseBackend>, dialect: Arc<dyn SqlDialect>, config: AppConfig, version: DbVersion, ) -> Self
Create a datasource from its parts.
Sourcepub async fn into_state(self) -> Result<AppState, Error>
pub async fn into_state(self) -> Result<AppState, Error>
Build an AppState and load the schema cache for this datasource.
Auto Trait Implementations§
impl Freeze for Datasource
impl !RefUnwindSafe for Datasource
impl Send for Datasource
impl Sync for Datasource
impl Unpin for Datasource
impl UnsafeUnpin for Datasource
impl !UnwindSafe for Datasource
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