pub struct UserId(/* private fields */);Implementations§
Source§impl UserId
impl UserId
Sourcepub unsafe fn from_raw_unchecked(id: i64) -> Self
pub unsafe fn from_raw_unchecked(id: i64) -> Self
§Safety
All SimpleX IDs are starting from 1 which is guaranteed by Sqlite and PostgreSQL DBs so it is generally safe to call this method when passing an ID value received from SimpleX backend.
In other cases of if in doubts - use from_raw for version that panics or Self::try_from for version that returns an error.
Sourcepub fn from_raw(id: i64) -> Self
pub fn from_raw(id: i64) -> Self
Panics when id == 0. Use Self::try_from to handle an error
pub fn raw(&self) -> i64
Trait Implementations§
impl Copy for UserId
impl Eq for UserId
Source§impl From<NonZero<i64>> for UserId
impl From<NonZero<i64>> for UserId
Source§fn from(id: NonZeroI64) -> Self
fn from(id: NonZeroI64) -> Self
Converts to this type from the input type.
Source§impl Ord for UserId
impl Ord for UserId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for UserId
impl PartialOrd for UserId
impl StructuralPartialEq for UserId
Auto Trait Implementations§
impl Freeze for UserId
impl RefUnwindSafe for UserId
impl Send for UserId
impl Sync for UserId
impl Unpin for UserId
impl UnsafeUnpin for UserId
impl UnwindSafe for UserId
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§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