Skip to main content

User

Struct User 

Source
pub struct User {
    pub id: String,
    pub name: String,
    pub email: String,
    pub role: String,
}
Expand description

A registered user on the platform.

Stored at PK = "USER#<id>", SK = "USER". Accessed via User::get(client, KeyId::pk(user_id)).

Fields§

§id: String§name: String§email: String§role: String

Trait Implementations§

Source§

impl Clone for User

Source§

fn clone(&self) -> User

Returns a duplicate 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 Debug for User

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for User

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl DynamoDBItem<PlatformTable> for User

Source§

type AdditionalAttributes = (ItemType, ())

Source§

fn to_item(&self) -> Item<TD>
where Self: Serialize,

Serializes self into an Item<TD>. Read more
Source§

fn try_from_item(item: Item<TD>) -> Result<Self>
where Self: DeserializeOwned,

Fallibly deserializes an Item<TD> into Self. Read more
Source§

fn from_item(item: Item<TD>) -> Self
where Self: DeserializeOwned,

Infallibly deserializes an Item<TD> into Self. Read more
Source§

impl HasAttribute<Email> for User

Source§

type Id<'id> = &'id str

The identifier extracted from &self, passed to attribute_value. Read more
Source§

type Value = String

A Rust type convertible to the DynamoDB attribute value for this attribute. Read more
Source§

fn attribute_id(&self) -> Self::Id<'_>

Extracts the attribute ID from this item.
Source§

fn attribute_value(id: Self::Id<'_>) -> Self::Value

Converts an attribute ID into a Rust value of type Self::Value which can then be converted into the correct AttributeValue at serialization using the via IntoTypedAttributeValue.
Source§

fn attribute(&self) -> Self::Value

Convenience method: calls attribute_id then attribute_value, returning a Rust value of type Self::Value.
Source§

impl HasAttribute<PK> for User

Source§

type Id<'id> = &'id str

The identifier extracted from &self, passed to attribute_value. Read more
Source§

type Value = String

A Rust type convertible to the DynamoDB attribute value for this attribute. Read more
Source§

fn attribute_id(&self) -> Self::Id<'_>

Extracts the attribute ID from this item.
Source§

fn attribute_value(id: Self::Id<'_>) -> Self::Value

Converts an attribute ID into a Rust value of type Self::Value which can then be converted into the correct AttributeValue at serialization using the via IntoTypedAttributeValue.
Source§

fn attribute(&self) -> Self::Value

Convenience method: calls attribute_id then attribute_value, returning a Rust value of type Self::Value.
Source§

impl HasConstAttribute<ItemType> for User

Source§

const VALUE: Self::Value = "USER"

The constant Rust value shared by all instances of this item type, later converted to the DynamoDB attribute value by the library.
Source§

type Value = &'static str

A Rust constant type convertible to the DynamoDB attribute value for this attribute. Read more
Source§

impl HasConstAttribute<SK> for User

Source§

const VALUE: Self::Value = "USER"

The constant Rust value shared by all instances of this item type, later converted to the DynamoDB attribute value by the library.
Source§

type Value = &'static str

A Rust constant type convertible to the DynamoDB attribute value for this attribute. Read more
Source§

impl Serialize for User

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for User

§

impl RefUnwindSafe for User

§

impl Send for User

§

impl Sync for User

§

impl Unpin for User

§

impl UnsafeUnpin for User

§

impl UnwindSafe for User

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
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, dest: *mut u8)

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

impl<TD, DBI> DynamoDBItemBatchOp<TD> for DBI
where TD: TableDefinition, DBI: DynamoDBItemOp<TD>,

Source§

fn batch_put(&self) -> WriteRequest
where Self: Serialize,

Creates a PutRequest WriteRequest for this item. Read more
Source§

fn batch_delete(&self) -> WriteRequest

Creates a DeleteRequest WriteRequest for this item’s key. Read more
Source§

fn batch_delete_by_id(key_id: Self::KeyId<'_>) -> WriteRequest

Creates a DeleteRequest WriteRequest from a key ID, without loading the item. Read more
Source§

impl<TD, DBI> DynamoDBItemOp<TD> for DBI
where TD: TableDefinition, DBI: DynamoDBItem<TD>,

Source§

fn get( client: Client, key_id: Self::KeyId<'_>, ) -> GetItemRequest<TD, Self, Typed>

Returns a GetItemRequest builder in Typed output mode for fetching a single item by key. Read more
Source§

fn put(&self, client: Client) -> PutItemRequest<TD, Self, Typed>
where Self: Serialize,

Returns a PutItemRequest builder in Typed output mode with ReturnNothing and no condition. Read more
Source§

fn delete(&self, client: Client) -> DeleteItemRequest<TD, Self, Typed>

Returns a DeleteItemRequest builder in Typed output mode with ReturnNothing and no condition. Read more
Source§

fn delete_by_id( client: Client, key_id: Self::KeyId<'_>, ) -> DeleteItemRequest<TD, Self, Typed, Return<Old>>

Returns a DeleteItemRequest builder in Typed output mode with Return<Old> and no condition. Read more
Source§

fn update( &self, client: Client, update: Update<'_>, ) -> UpdateItemRequest<TD, Self, Typed>

Returns an UpdateItemRequest builder in Typed output mode with ReturnNothing and no condition. Read more
Source§

fn update_by_id( client: Client, key_id: Self::KeyId<'_>, update: Update<'_>, ) -> UpdateItemRequest<TD, Self, Typed, Return<New>>

Returns an UpdateItemRequest builder in Typed output mode with Return<New> and no condition. Read more
Source§

fn scan(client: Client) -> ScanRequest<TD, Self, Typed>

Returns a ScanRequest builder in Typed output mode for scanning the entire table. Read more
Source§

fn scan_index<I: IndexDefinition<TD>>( client: Client, ) -> ScanRequest<TD, Self, Typed>
where Self: HasIndexKeyAttributes<TD, I>,

Returns a ScanRequest builder in Typed output mode for scanning a secondary index (GSI or LSI). Read more
Source§

fn query( client: Client, key_condition: KeyCondition<'_, TD::KeySchema, impl KeyConditionState>, ) -> QueryRequest<TD, Self, Typed>

Returns a QueryRequest builder in Typed output mode for querying the table with the given key condition. Read more
Source§

fn query_all(client: Client) -> QueryRequest<TD, Self, Typed>

Returns a QueryRequest builder in Typed output mode, using the type’s constant partition key value as the key condition. Read more
Source§

fn query_index<I: IndexDefinition<TD>>( client: Client, key_condition: KeyCondition<'_, I::KeySchema, impl KeyConditionState>, ) -> QueryRequest<TD, Self, Typed>
where Self: HasIndexKeyAttributes<TD, I>,

Returns a QueryRequest builder in Typed output mode for querying a secondary index (GSI or LSI) with the given key condition. Read more
Source§

fn query_all_index<I: IndexDefinition<TD>>( client: Client, ) -> QueryRequest<TD, Self, Typed>
where Self: HasIndexKeyAttributes<TD, I> + HasConstAttribute<<I::KeySchema as KeySchema>::PartitionKey>,

Returns a QueryRequest builder in Typed output mode for querying a secondary index (GSI or LSI) using the type’s constant PK value for that index. Read more
Source§

fn exists() -> Condition<'static>

Returns a Condition that checks whether an item exists. Read more
Source§

fn not_exists() -> Condition<'static>

Returns a Condition that checks whether an item does not exist. Read more
Source§

fn key_condition( pk_id: <Self as HasAttribute<<<TD as TableDefinition>::KeySchema as KeySchema>::PartitionKey>>::Id<'_>, ) -> KeyCondition<'static, TD::KeySchema>

Builds a KeyCondition for the table’s partition key from a typed ID. Read more
Source§

fn index_key_condition<I: IndexDefinition<TD>>( pk_id: <Self as HasAttribute<<I::KeySchema as KeySchema>::PartitionKey>>::Id<'_>, ) -> KeyCondition<'static, I::KeySchema>

Builds a KeyCondition for a secondary index’s partition key from a typed ID. Read more
Source§

impl<TD, DBI> DynamoDBItemTransactOp<TD> for DBI
where TD: TableDefinition, DBI: DynamoDBItemOp<TD>,

Source§

fn transact_put(&self) -> TransactPutRequest<TD, Self>
where Self: Serialize,

Creates a TransactPutRequest for this item. Read more
Source§

fn transact_delete(&self) -> TransactDeleteRequest<TD, Self>

Creates a TransactDeleteRequest for this item’s key. Read more
Source§

fn transact_delete_by_id( key_id: Self::KeyId<'_>, ) -> TransactDeleteRequest<TD, Self>

Creates a TransactDeleteRequest from a key ID, without loading the item. Read more
Source§

fn transact_update(&self, update: Update<'_>) -> TransactUpdateRequest<TD, Self>

Creates a TransactUpdateRequest using the key of self and the given Update. Read more
Source§

fn transact_update_by_id( key_id: Self::KeyId<'_>, update: Update<'_>, ) -> TransactUpdateRequest<TD, Self>

Creates a TransactUpdateRequest from a key ID and an Update expression. Read more
Source§

fn transact_condition( &self, condition: Condition<'_>, ) -> TransactConditionCheckRequest<TD, Self>

Creates a TransactConditionCheckRequest using the key of self. Read more
Source§

fn transact_condition_by_id( key_id: Self::KeyId<'_>, condition: Condition<'_>, ) -> TransactConditionCheckRequest<TD, Self>

Creates a TransactConditionCheckRequest from a key ID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<A, T> HasAttribute<A> for T

Source§

type Id<'a> = NoId

The identifier extracted from &self, passed to attribute_value. Read more
Source§

type Value = <T as HasConstAttribute<A>>::Value

A Rust type convertible to the DynamoDB attribute value for this attribute. Read more
Source§

fn attribute_id(&self) -> <T as HasAttribute<A>>::Id<'_>

Extracts the attribute ID from this item.
Source§

fn attribute_value( _id: <T as HasAttribute<A>>::Id<'_>, ) -> <T as HasAttribute<A>>::Value

Converts an attribute ID into a Rust value of type Self::Value which can then be converted into the correct AttributeValue at serialization using the via IntoTypedAttributeValue.
Source§

fn attribute(&self) -> Self::Value

Convenience method: calls attribute_id then attribute_value, returning a Rust value of type Self::Value.
Source§

impl<T> Instrument for T

Source§

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

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

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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<Unshared, Shared> IntoShared<Shared> for Unshared
where Shared: FromUnshared<Unshared>,

Source§

fn into_shared(self) -> Shared

Creates a shared type from an unshared type.
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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,