Skip to main content

UserDetails

Struct UserDetails 

Source
pub struct UserDetails {
    pub name: String,
    pub bio: Option<String>,
    pub id: PubkyId,
    pub links: Option<Vec<PubkyAppUserLink>>,
    pub status: Option<String>,
    pub image: Option<String>,
    pub indexed_at: i64,
}
Expand description

Represents user data with name, bio, image, links, and status.

Fields§

§name: String§bio: Option<String>§id: PubkyId§links: Option<Vec<PubkyAppUserLink>>§status: Option<String>§image: Option<String>§indexed_at: i64

Implementations§

Source§

impl UserDetails

Source

pub async fn get_by_id(user_id: &str) -> Result<Option<Self>, DynError>

Retrieves details by user ID, first trying to get from Redis, then from Neo4j if not found.

Source

pub async fn from_homeserver( homeserver_user: PubkyAppUser, user_id: &PubkyId, ) -> Result<Self, DynError>

Source

pub async fn delete(user_id: &str) -> Result<(), DynError>

Trait Implementations§

Source§

impl Clone for UserDetails

Source§

fn clone(&self) -> UserDetails

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Collection<&str> for UserDetails

Source§

fn collection_details_graph_query(id_list: &[&str]) -> Query

Returns the neo4j query to return a list records by passing a list of ids. The query should return each record in the “record” attribute of the node.
Source§

fn put_graph_query(&self) -> Result<Query, DynError>

Returns the neo4j query to put a record into the graph.
Source§

fn extend_on_index_miss<'life0, 'async_trait>( details: &'life0 [Option<Self>], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn get_by_ids<'life0, 'async_trait>( ids: &'life0 [T], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Self>>, DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Retrieves records by their IDs, first attempting to fetch them from a cache (e.g., Redis), and then querying a graph database (e.g., Neo4j) if necessary. Read more
Source§

fn get_from_graph<'life0, 'async_trait>( ids: &'life0 [T], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Self>>, DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Queries a Neo4j graph database to retrieve records based on the provided IDs and collection type. Read more
Source§

fn get_from_index<'life0, 'life1, 'async_trait>( keys: Vec<&'life0 [&'life1 str]>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Self>>, DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn put_to_index<'life0, 'async_trait>( ids: &'life0 [T], records: Vec<Option<Self>>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Indexes collection of records in Redis for faster access in future queries. Read more
Source§

fn put_to_graph<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait,

Source§

fn reindex<'life0, 'async_trait>( collection_ids: &'life0 [T], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Source§

impl ComposeSchema for UserDetails

Source§

impl Debug for UserDetails

Source§

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

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

impl Default for UserDetails

Source§

fn default() -> UserDetails

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

impl<'de> Deserialize<'de> for UserDetails

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 RedisOps for UserDetails

Source§

fn prefix<'async_trait>() -> Pin<Box<dyn Future<Output = String> + Send + 'async_trait>>
where Self: 'async_trait,

Provides a prefix string for the Redis key. Read more
Source§

fn put_index_json<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, key_parts: &'life1 [&'life2 str], prefix: Option<String>, expiration: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Sets the data in Redis using the provided key parts. Read more
Source§

fn try_from_index_json<'life0, 'life1, 'async_trait>( key_parts: &'life0 [&'life1 str], prefix: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves data from Redis using the provided key parts. Read more
Source§

fn try_from_index_multiple_json<'life0, 'life1, 'life2, 'async_trait>( key_parts_list: &'life0 [&'life1 [&'life2 str]], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<Self>>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieves multiple JSON objects from Redis using the provided key parts. Read more
Source§

fn put_multiple_json_indexes<'life0, 'life1, 'life2, 'async_trait>( key_parts_list: &'life0 [&'life1 [&'life2 str]], collection: Vec<Option<Self>>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Stores multiple key-value pairs in Redis, where each key is constructed from the provided key parts and each value is an item from the given collection. Read more
Source§

fn remove_from_index_multiple_json<'life0, 'life1, 'life2, 'async_trait>( key_parts_list: &'life0 [&'life1 [&'life2 str]], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Removes multiple JSON objects from Redis using the provided key parts. Read more
Source§

fn modify_json_field<'life0, 'life1, 'life2, 'async_trait>( key_parts: &'life0 [&'life1 str], field: &'life2 str, action: JsonAction, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Modifies a numeric field in a Redis JSON object by either incrementing or decrementing it. Read more
Source§

fn put_index_list<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, key_parts: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: AsRef<[T]> + 'async_trait, T: AsRef<str> + Send + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Adds elements to a Redis list using the provided key parts. Read more
Source§

fn try_from_index_list<'life0, 'life1, 'async_trait>( key_parts: &'life0 [&'life1 str], skip: Option<usize>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves a range of elements from a Redis list using the provided key parts. Read more
Source§

fn put_index_set<'life0, 'life1, 'life2, 'life3, 'async_trait>( key_parts: &'life0 [&'life1 str], values: &'life2 [&'life3 str], expiration: Option<i64>, prefix: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Adds elements to a Redis set using the provided key parts. Read more
Source§

fn remove_from_index_set<'life0, 'life1, 'life2, 'async_trait, T>( &'life0 self, key_parts: &'life1 [&'life2 str], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: AsRef<[T]> + 'async_trait, T: AsRef<str> + Send + Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Removes elements from a Redis set using the provided key parts. Read more
Source§

fn try_from_index_set<'life0, 'life1, 'async_trait>( key_parts: &'life0 [&'life1 str], skip: Option<usize>, limit: Option<usize>, prefix: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves a range of elements from a Redis set using the provided key parts. Read more
Source§

fn check_set_member<'life0, 'life1, 'life2, 'async_trait>( key_parts: &'life0 [&'life1 str], member: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(bool, bool), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Checks if a member exists in a Redis set and if the set exists using the provided key parts. Read more
Source§

fn get_set_size<'life0, 'life1, 'async_trait>( key_parts: &'life0 [&'life1 str], ) -> Pin<Box<dyn Future<Output = Result<Option<usize>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves the size of a Redis set using the provided key parts. Read more
Source§

fn try_from_multiple_sets<'life0, 'life1, 'life2, 'async_trait>( key_parts_list: &'life0 [&'life1 str], prefix: Option<String>, member: Option<&'life2 str>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<(Vec<String>, usize, bool)>>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Fetches multiple sets from Redis using the specified key components. Read more
Source§

fn put_multiple_set_indexes<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'async_trait>( common_key: &'life0 [&'life1 str], index: &'life2 [&'life3 str], collections_refs: &'life4 [Vec<&'life5 str>], prefix: Option<String>, expiration: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait, 'life5: 'async_trait,

Adds elements to multiple Redis sets using the provided keys and collections. Read more
Source§

fn try_get_random_from_index_set<'life0, 'life1, 'async_trait>( key_parts: &'life0 [&'life1 str], count: isize, prefix: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, DynError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Retrieves random elements from a Redis set using the provided key parts. Read more
Source§

fn check_sorted_set_member<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( prefix: Option<&'life0 str>, key_parts: &'life1 [&'life2 str], member: &'life3 [&'life4 str], ) -> Pin<Box<dyn Future<Output = Result<Option<isize>, DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Checks if a member exists in a Redis sorted set and retrieves its score if it exists. Read more
Source§

fn put_index_sorted_set<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( key_parts: &'life0 [&'life1 str], elements: &'life2 [(f64, &'life3 str)], prefix: Option<&'life4 str>, expiration: Option<i64>, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Adds elements to a Redis sorted set using the provided key parts. Read more
Source§

fn put_score_index_sorted_set<'life0, 'life1, 'life2, 'life3, 'async_trait>( key_parts: &'life0 [&'life1 str], member: &'life2 [&'life3 str], score_mutation: ScoreAction, ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Updates the score of a member in a Redis sorted set. Read more
Source§

fn remove_from_index_sorted_set<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( prefix: Option<&'life0 str>, key_parts: &'life1 [&'life2 str], items: &'life3 [&'life4 str], ) -> Pin<Box<dyn Future<Output = Result<(), DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Removes elements from a Redis sorted set using the provided key parts. Read more
Source§

fn try_from_index_sorted_set<'life0, 'life1, 'life2, 'async_trait>( key_parts: &'life0 [&'life1 str], start: Option<f64>, end: Option<f64>, skip: Option<usize>, limit: Option<usize>, sorting: SortOrder, prefix: Option<&'life2 str>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<(String, f64)>>, DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Retrieves a range of elements from a Redis sorted set using the provided key parts. Read more
Source§

fn try_from_index_sorted_set_lex<'life0, 'life1, 'life2, 'life3, 'async_trait>( key_parts: &'life0 [&'life1 str], min: &'life2 str, max: &'life3 str, skip: Option<usize>, limit: Option<usize>, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<String>>, DynError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Retrieves a lexicographical range of elements from a Redis sorted set using the provided key parts. Read more
Source§

impl Serialize for UserDetails

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

impl ToSchema for UserDetails

Source§

fn name() -> Cow<'static, str>

Return name of the schema. Read more
Source§

fn schemas(schemas: &mut Vec<(String, RefOr<Schema>)>)

Implement reference utoipa::openapi::schema::Schemas for this 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
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<T> CompatExt for T

Source§

fn compat(self) -> Compat<T>
where T: Sized,

Applies the Compat adapter by value. Read more
Source§

fn compat_ref(&self) -> Compat<&T>

Applies the Compat adapter by shared reference. Read more
Source§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the Compat adapter by mutable reference. Read more
Source§

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

Source§

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

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
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> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<L> LayerExt<L> for L

Source§

fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>
where L: Layer<S>,

Applies the layer to a service and wraps it in Layered.
Source§

impl<T> MaybeSendSync for T

Source§

impl<T> PartialSchema for T
where T: ComposeSchema + ?Sized,

Source§

fn schema() -> RefOr<Schema>

Return ref or schema of implementing type that can then be used to construct combined schemas.
Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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