pub struct DataTrackerClient { /* private fields */ }Expand description
Client for the IETF Datatracker REST API. Used for search and for metadata lookups (titles, draft revisions).
Implementations§
Source§impl DataTrackerClient
impl DataTrackerClient
Sourcepub fn with_client(client: Client) -> Self
pub fn with_client(client: Client) -> Self
Build a client that reuses an existing HTTP client.
Sourcepub async fn search(
&self,
query: &str,
filter: SearchFilter,
limit: u32,
) -> Result<SearchResult>
pub async fn search( &self, query: &str, filter: SearchFilter, limit: u32, ) -> Result<SearchResult>
Search for documents matching the query.
The query is tokenized on whitespace and pushed to the server as much as possible:
- the longest token becomes a
title__icontainsfilter, - the second-longest (if any) becomes an
abstract__icontainsfilter, type__inhonors the caller’sSearchFilter, defaulting torfc,draftso the response doesn’t include slides, charters, etc.
Any remaining (3rd+) tokens are AND-ed locally against title+abstract. This makes queries like “bgp message” work without the user having to guess the exact phrase, while keeping the JSON payload (and latency) small.
Sourcepub async fn get_document(&self, name: &str) -> Result<Document>
pub async fn get_document(&self, name: &str) -> Result<Document>
Fetch a single document’s metadata by canonical name.
Auto Trait Implementations§
impl !RefUnwindSafe for DataTrackerClient
impl !UnwindSafe for DataTrackerClient
impl Freeze for DataTrackerClient
impl Send for DataTrackerClient
impl Sync for DataTrackerClient
impl Unpin for DataTrackerClient
impl UnsafeUnpin for DataTrackerClient
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