pub struct Users {
pool: &'static Pool<Sqlite>,
}
Fields§
§pool: &'static Pool<Sqlite>
Implementations§
source§impl Users
impl Users
sourcepub(super) async fn init(pool: &'static Pool<Sqlite>) -> Result<Self>
pub(super) async fn init(pool: &'static Pool<Sqlite>) -> Result<Self>
This method sets up the database by creating required tables if they do not already exist.
sourcepub(super) async fn register(
&self,
user: &UserWithPassword
) -> Result<(), RegistrationError>
pub(super) async fn register( &self, user: &UserWithPassword ) -> Result<(), RegistrationError>
This method registers a new user by inserting a record to the database or returns an error if that is not possible (e.g. the username is already taken).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Users
impl !RefUnwindSafe for Users
impl Send for Users
impl Sync for Users
impl Unpin for Users
impl !UnwindSafe for Users
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>
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