pub struct DoSearchRequest {
pub search: String,
pub restypes: Option<List<u32>>,
pub order_by: Option<String>,
pub archive: Option<i8>,
pub fetchrows: Option<FetchRows>,
pub sort: Option<SortOrder>,
pub offset: Option<u32>,
}Fields§
§search: StringThe search string to match resources against.
restypes: Option<List<u32>>Comma-separated list of resource type IDs to restrict results to.
order_by: Option<String>Field name to order results by.
archive: Option<i8>Archive status filter: 0 = live, 1 = archived, 2 = deleted.
fetchrows: Option<FetchRows>Number of rows to return, or "offset,rows" for paginated fetching.
sort: Option<SortOrder>Sort direction for the results.
offset: Option<u32>Number of results to skip, used for pagination.
Implementations§
Source§impl DoSearchRequest
impl DoSearchRequest
Sourcepub fn new(search: impl Into<String>) -> Self
pub fn new(search: impl Into<String>) -> Self
Examples found in repository?
examples/basic.rs (line 27)
8async fn main() {
9 dotenvy::from_path("examples/.env").ok();
10
11 let base_url = std::env::var("RS_BASE_URL").expect("RS_BASE_URL not set");
12 let user = std::env::var("RS_USER").expect("RS_USER not set");
13 let _password = std::env::var("RS_PASS").expect("RS_PASS not set");
14 let key = std::env::var("RS_KEY").expect("RS_KEY not set");
15
16 let client = Client::builder()
17 .base_url(&base_url)
18 .expect("Error when setting base_url")
19 .user_key(&user, &key)
20 // .session_key(&user, &password)
21 .build()
22 .await
23 .expect("Error when building client");
24
25 let search_result = client
26 .search()
27 .do_search(DoSearchRequest::new("909").sort(SortOrder::Asc))
28 .await;
29
30 match search_result {
31 Ok(response) => println!("{:#?}", response),
32 Err(e) => println!("Error: {}", e),
33 }
34
35 let system_result = client
36 .system()
37 .get_daily_stat_summary(GetDailyStatSummaryRequest::new().days(31))
38 .await;
39
40 match system_result {
41 Ok(response) => println!("{:#?}", response),
42 Err(e) => println!("Error: {}", e),
43 }
44
45 let message_result = client
46 .message()
47 .get_user_message(GetUserMessageRequest::new(12))
48 .await;
49
50 match message_result {
51 Ok(response) => println!("{:#?}", response),
52 Err(e) => println!("Error: {}", e),
53 }
54}pub fn restypes(self, restypes: impl Into<List<u32>>) -> Self
pub fn order_by(self, order_by: impl Into<String>) -> Self
pub fn archive(self, archive: i8) -> Self
pub fn fetchrows(self, fetchrows: FetchRows) -> Self
Sourcepub fn sort(self, sort: SortOrder) -> Self
pub fn sort(self, sort: SortOrder) -> Self
Examples found in repository?
examples/basic.rs (line 27)
8async fn main() {
9 dotenvy::from_path("examples/.env").ok();
10
11 let base_url = std::env::var("RS_BASE_URL").expect("RS_BASE_URL not set");
12 let user = std::env::var("RS_USER").expect("RS_USER not set");
13 let _password = std::env::var("RS_PASS").expect("RS_PASS not set");
14 let key = std::env::var("RS_KEY").expect("RS_KEY not set");
15
16 let client = Client::builder()
17 .base_url(&base_url)
18 .expect("Error when setting base_url")
19 .user_key(&user, &key)
20 // .session_key(&user, &password)
21 .build()
22 .await
23 .expect("Error when building client");
24
25 let search_result = client
26 .search()
27 .do_search(DoSearchRequest::new("909").sort(SortOrder::Asc))
28 .await;
29
30 match search_result {
31 Ok(response) => println!("{:#?}", response),
32 Err(e) => println!("Error: {}", e),
33 }
34
35 let system_result = client
36 .system()
37 .get_daily_stat_summary(GetDailyStatSummaryRequest::new().days(31))
38 .await;
39
40 match system_result {
41 Ok(response) => println!("{:#?}", response),
42 Err(e) => println!("Error: {}", e),
43 }
44
45 let message_result = client
46 .message()
47 .get_user_message(GetUserMessageRequest::new(12))
48 .await;
49
50 match message_result {
51 Ok(response) => println!("{:#?}", response),
52 Err(e) => println!("Error: {}", e),
53 }
54}pub fn offset(self, offset: u32) -> Self
Trait Implementations§
Source§impl Clone for DoSearchRequest
impl Clone for DoSearchRequest
Source§fn clone(&self) -> DoSearchRequest
fn clone(&self) -> DoSearchRequest
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DoSearchRequest
impl Debug for DoSearchRequest
Source§impl PartialEq for DoSearchRequest
impl PartialEq for DoSearchRequest
Source§impl Serialize for DoSearchRequest
impl Serialize for DoSearchRequest
impl StructuralPartialEq for DoSearchRequest
Auto Trait Implementations§
impl Freeze for DoSearchRequest
impl RefUnwindSafe for DoSearchRequest
impl Send for DoSearchRequest
impl Sync for DoSearchRequest
impl Unpin for DoSearchRequest
impl UnsafeUnpin for DoSearchRequest
impl UnwindSafe for DoSearchRequest
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