pub struct Entries<'a> { /* private fields */ }Expand description
Sub-client for the Entries endpoint.
Obtained via crate::Delivery::entries - never constructed directly.
Implementations§
Source§impl<'a> Entries<'a>
impl<'a> Entries<'a>
Sourcepub async fn get_many<T>(
&self,
content_type: &str,
params: Option<GetManyParams>,
) -> Result<EntriesResponse<T>>where
T: for<'de> Deserialize<'de>,
pub async fn get_many<T>(
&self,
content_type: &str,
params: Option<GetManyParams>,
) -> Result<EntriesResponse<T>>where
T: for<'de> Deserialize<'de>,
Fetches multiple entries for a given content type.
§Arguments
content_type- The content type UID (e.g."blog_post")params- Optional query parameters (filters, pagination, locale)
§Example
use serde::Deserialize;
use contentstack_api_client_rs::{Delivery, GetManyParams};
#[derive(Deserialize)]
struct BlogPost { body: String }
let client = Delivery::new("api_key", "token", "production", None);
let response = client.entries()
.get_many::<BlogPost>("blog_post", None)
.await?;
println!("Total: {}", response.entries.len());Sourcepub async fn get_one<T>(
&self,
content_type: &str,
uid: &str,
params: Option<GetOneParams>,
) -> Result<EntryResponse<T>>where
T: for<'de> Deserialize<'de>,
pub async fn get_one<T>(
&self,
content_type: &str,
uid: &str,
params: Option<GetOneParams>,
) -> Result<EntryResponse<T>>where
T: for<'de> Deserialize<'de>,
Fetches a single entry by UID for a given content type.
§Arguments
content_type- The content type UID (e.g."blog_post")uid- The entry UID to fetchparams- Optional query parameters (locale, query filter)
§Example
use serde::Deserialize;
use contentstack_api_client_rs::{Delivery, GetOneParams};
#[derive(Deserialize)]
struct BlogPost { body: String }
let client = Delivery::new("api_key", "token", "production", None);
let response = client.entries()
.get_one::<BlogPost>("blog_post", "entry_uid_123", None)
.await?;
println!("Title: {}", response.entry.title);Auto Trait Implementations§
impl<'a> Freeze for Entries<'a>
impl<'a> !RefUnwindSafe for Entries<'a>
impl<'a> Send for Entries<'a>
impl<'a> Sync for Entries<'a>
impl<'a> Unpin for Entries<'a>
impl<'a> UnsafeUnpin for Entries<'a>
impl<'a> !UnwindSafe for Entries<'a>
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