Crates.io | contentful |
lib.rs | contentful |
version | 0.8.0 |
source | src |
created_at | 2020-08-06 20:32:59.504496 |
updated_at | 2023-10-25 08:32:03.059565 |
description | Contentful API Rust Client |
homepage | https://github.com/sajuthankappan/contentful-rs |
repository | https://github.com/sajuthankappan/contentful-rs |
max_upload_size | |
id | 273744 |
size | 48,338 |
Contentful API Rust Client
let contentful_client = ContentfulClient::new("<access_token>", "<space_id>");
let product = contentful_client.get_entry::<Product>("<entry_id>").await?;
if let Some(product) = product {
let name = product.name;
//..
}
For more examples, please see the tests folder
To get a single entry use the get_entry
let product = contentful_client.get_entry::<Product>("<entry_id>").await?;
There are several methods to retrieve multiple entries available in the SDK.
let builder = QueryBuilder::new()
.content_type_is("product")
.field_equals("fields.name", name);
let products = contentful_client
.get_entries::<Product>(Some(builder))
.await?