Struct autopush_common::db::UserBuilder

source ·
pub struct UserBuilder { /* private fields */ }
Expand description

Builder for User.

Implementations§

source§

impl UserBuilder

source

pub fn uaid(&mut self, value: Uuid) -> &mut Self

The UAID. This is generally a UUID4. It needs to be globally unique.

source

pub fn connected_at(&mut self, value: u64) -> &mut Self

Time in milliseconds that the user last connected at

source

pub fn router_type(&mut self, value: String) -> &mut Self

Router type of the user

source

pub fn router_data(&mut self, value: HashMap<String, Value>) -> &mut Self

Router-specific data

source

pub fn node_id(&mut self, value: String) -> &mut Self

Last node/port the client was or may be connected to

source

pub fn record_version(&mut self, value: u64) -> &mut Self

Record version

source

pub fn current_timestamp(&mut self, value: u64) -> &mut Self

the timestamp of the last notification sent to the user This field is exclusive to the Bigtable data scheme

source

pub fn version(&mut self, value: Uuid) -> &mut Self

UUID4 version number for optimistic locking of updates on Bigtable

source

pub fn priv_channels(&mut self, value: HashSet<Uuid>) -> &mut Self

Set of user’s channel ids. These are stored in router (user) record’s row in Bigtable. They are read along with the rest of the user record so that them, along with every other field in the router record, will automatically have their TTL (cell timestamp) reset during [DbClient::update_user].

This is solely used for the sake of that update thus private. [DbClient::get_channels] is preferred for reading the latest version of the channel ids (partly due to historical purposes but also is a more flexible API that might benefit different, non Bigtable [DbClient] backends that don’t necessarily store the channel ids in the router record).

source

pub fn build(&self) -> Result<User, UserBuilderError>

Builds a new User.

§Errors

If a required field has not been initialized.

Trait Implementations§

source§

impl Clone for UserBuilder

source§

fn clone(&self) -> UserBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Default for UserBuilder

source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Any for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

§

fn type_name(&self) -> &'static str

§

impl<T> AnySync for T
where T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

source§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<T> SendSyncUnwindSafe for T
where T: Send + Sync + UnwindSafe + ?Sized,