pub struct PostgresService;Expand description
Postgres availability as a Cordis Service — runtime check, not compile-time cfg.
check() returns cfg!(feature = "postgres") so callers can branch at runtime:
if ctx.get::<PostgresService>().is_some_and(|s| s.check()) { /* postgres path */ }
or if ctx.get::<PostgresService>().is_some() { use db } else { fallback }.
Trait Implementations§
Source§impl Service for PostgresService
impl Service for PostgresService
Auto Trait Implementations§
impl Freeze for PostgresService
impl RefUnwindSafe for PostgresService
impl Send for PostgresService
impl Sync for PostgresService
impl Unpin for PostgresService
impl UnsafeUnpin for PostgresService
impl UnwindSafe for PostgresService
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