pub struct Database {
pub pool: PgPool,
}
Fields
pool: PgPool
Implementations
sourceimpl Database
impl Database
pub async fn migrate(&self) -> Result<(), ServiceError>
pub async fn ping(&self) -> bool
sourcepub async fn delete_user(&self, username: &str) -> Result<(), ServiceError>
pub async fn delete_user(&self, username: &str) -> Result<(), ServiceError>
delete a user
sourcepub async fn username_exists(
&self,
username: &str
) -> Result<bool, ServiceError>
pub async fn username_exists(
&self,
username: &str
) -> Result<bool, ServiceError>
check if username exists
sourcepub async fn email_exists(&self, email: &str) -> Result<bool, ServiceError>
pub async fn email_exists(&self, email: &str) -> Result<bool, ServiceError>
check if email exists
sourcepub async fn update_email(
&self,
p: &UpdateEmail<'_>
) -> Result<(), ServiceError>
pub async fn update_email(
&self,
p: &UpdateEmail<'_>
) -> Result<(), ServiceError>
update a user’s email
sourcepub async fn get_password(
&self,
l: &Login<'_>
) -> Result<NameHash, ServiceError>
pub async fn get_password(
&self,
l: &Login<'_>
) -> Result<NameHash, ServiceError>
get a user’s password
sourcepub async fn update_password(&self, p: &NameHash) -> Result<(), ServiceError>
pub async fn update_password(&self, p: &NameHash) -> Result<(), ServiceError>
update user’s password
sourcepub async fn update_username(
&self,
current: &str,
new: &str
) -> Result<(), ServiceError>
pub async fn update_username(
&self,
current: &str,
new: &str
) -> Result<(), ServiceError>
update username
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl !UnwindSafe for Database
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more