Struct EPostResult
pub struct EPostResult {
pub webenv: String,
pub query_key: String,
}Expand description
Result from EPost API for uploading PMIDs to the NCBI History server
EPost stores a list of UIDs (PMIDs) on the History server and returns
WebEnv/query_key identifiers. These can then be used with fetch_from_history()
to retrieve article metadata, or combined with other E-utility calls.
§Example
ⓘ
use pubmed_client::PubMedClient;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = PubMedClient::new();
// Upload a list of PMIDs to the history server
let result = client.epost(&["31978945", "33515491", "25760099"]).await?;
// Use the session to fetch articles
let session = result.history_session();
let articles = client.fetch_from_history(&session, 0, 100).await?;
println!("Fetched {} articles", articles.len());
Ok(())
}Fields§
§webenv: StringWebEnv session identifier for the uploaded IDs
query_key: StringQuery key for the uploaded IDs within the session
Implementations§
§impl EPostResult
impl EPostResult
pub fn history_session(&self) -> HistorySession
pub fn history_session(&self) -> HistorySession
Convert to a HistorySession for use with fetch_from_history()
This is a convenience method that creates a HistorySession from the
EPost result, which can then be passed to fetch_from_history().
Trait Implementations§
§impl Clone for EPostResult
impl Clone for EPostResult
§fn clone(&self) -> EPostResult
fn clone(&self) -> EPostResult
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 moreAuto Trait Implementations§
impl Freeze for EPostResult
impl RefUnwindSafe for EPostResult
impl Send for EPostResult
impl Sync for EPostResult
impl Unpin for EPostResult
impl UnwindSafe for EPostResult
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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