pub struct DefaultUser {
pub display_name: String,
pub is_bot: bool,
}ffi only.Expand description
The SimpleX user profile used to initialise the chat instance.
§Security
The display_name field is injected into a SimpleX CLI command of the form /create {kind} '{display_name}'. It is intended to be a short, fixed, ASCII identifier chosen by the
application author, do not supply a user-input here to avoid command injections like:
“User’Name”(creates a user named “User” with bio=“Name”)
Fields§
§display_name: String§is_bot: boolImplementations§
Source§impl DefaultUser
impl DefaultUser
Sourcepub fn regular<S>(name: S) -> DefaultUser
pub fn regular<S>(name: S) -> DefaultUser
Creates a regular SimpleX user profile with the given display name.
name is injected literally into /create user '{name}'. Use a fixed ASCII identifier;
do not pass user-supplied input here.
Sourcepub fn bot<S>(name: S) -> DefaultUser
pub fn bot<S>(name: S) -> DefaultUser
Creates a bot SimpleX user profile with the given display name.
name is injected literally into /create bot '{name}'. Use a fixed ASCII identifier;
do not pass user-supplied input here.
Trait Implementations§
Source§impl Clone for DefaultUser
impl Clone for DefaultUser
Source§fn clone(&self) -> DefaultUser
fn clone(&self) -> DefaultUser
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DefaultUser
impl RefUnwindSafe for DefaultUser
impl Send for DefaultUser
impl Sync for DefaultUser
impl Unpin for DefaultUser
impl UnsafeUnpin for DefaultUser
impl UnwindSafe for DefaultUser
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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