Function restapi::requests::user::search_user_data::search_user_data
source · [−]pub async fn search_user_data(
tracking_label: &str,
config: &CoreConfig,
db_pool: &Pool<PostgresConnectionManager<MakeTlsConnector>>,
kafka_pool: &KafkaPublisher,
headers: &HeaderMap<HeaderValue>,
bytes: &[u8]
) -> Result<Response<Body>, Infallible>
Expand description
search_user_data
Search for matching users_data
records by the POST-ed
ApiReqUserSearchData
(filters) and return a list of
ModelUserData
within the
ApiResUserSearchData
Overview Notes
A user can have many records in the users_data
table.
Arguments
tracking_label
-&str
- caller logging labelconfig
-CoreConfig
db_pool
-Pool
- postgres client db threadpool with required tls encryptionkafka_pool
-KafkaPublisher
for asynchronously publishing messages to the connected kafka clusterheaders
-HeaderMap
- hashmap containing headers in key-value pairsRequest
’sBody
bytes
-&[u8]
- received bytes from the hyperRequest
’sBody
Returns
search_user_data on Success Returns
List of matching users_data
records from the db
hyper Response
containing a json-serialized
ApiResUserSearchData
dictionary within the
Body
and a
200
HTTP status code
Ok(Response
)
Errors
search_user_data on Failure Returns
All errors return as a
hyper Response
containing a json-serialized
ApiResUserSearchData
dictionary with a
non-200
HTTP status code
Err(Response
)