pub struct ChangeUserOpts { /* private fields */ }
Expand description
COM_CHANGE_USER
options.
Connection Opts
are going to be updated accordingly upon COM_CHANGE_USER
.
Opts
won’t be updated by default, because default ChangeUserOpts
will reuse
connection’s user
, pass
and db_name
.
Implementations§
Source§impl ChangeUserOpts
impl ChangeUserOpts
Sourcepub fn with_user(self, user: Option<String>) -> Self
pub fn with_user(self, user: Option<String>) -> Self
Set Opts::user
to the given value.
Sourcepub fn with_pass(self, pass: Option<String>) -> Self
pub fn with_pass(self, pass: Option<String>) -> Self
Set Opts::pass
to the given value.
Sourcepub fn with_db_name(self, db_name: Option<String>) -> Self
pub fn with_db_name(self, db_name: Option<String>) -> Self
Set Opts::db_name
to the given value.
Sourcepub fn user(&self) -> Option<Option<&str>>
pub fn user(&self) -> Option<Option<&str>>
Returns user.
- if
None
thenself
does not meant to change user - if
Some(None)
thenself
will clear user - if
Some(Some(_))
thenself
will change user
Trait Implementations§
Source§impl Clone for ChangeUserOpts
impl Clone for ChangeUserOpts
Source§fn clone(&self) -> ChangeUserOpts
fn clone(&self) -> ChangeUserOpts
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ChangeUserOpts
impl Debug for ChangeUserOpts
Source§impl Default for ChangeUserOpts
impl Default for ChangeUserOpts
Source§impl PartialEq for ChangeUserOpts
impl PartialEq for ChangeUserOpts
impl Eq for ChangeUserOpts
impl StructuralPartialEq for ChangeUserOpts
Auto Trait Implementations§
impl Freeze for ChangeUserOpts
impl RefUnwindSafe for ChangeUserOpts
impl Send for ChangeUserOpts
impl Sync for ChangeUserOpts
impl Unpin for ChangeUserOpts
impl UnwindSafe for ChangeUserOpts
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.