contentful

Crates.iocontentful
lib.rscontentful
version0.8.0
sourcesrc
created_at2020-08-06 20:32:59.504496
updated_at2023-10-25 08:32:03.059565
descriptionContentful API Rust Client
homepagehttps://github.com/sajuthankappan/contentful-rs
repositoryhttps://github.com/sajuthankappan/contentful-rs
max_upload_size
id273744
size48,338
core (github:oxidizer-rs:core)

documentation

README

contentful-rs   Latest Version Docs

Contentful API Rust Client

Usage example

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

Querying for content

Get a single entry

To get a single entry use the get_entry method.

let product = contentful_client.get_entry::<Product>("<entry_id>").await?;

Get multiple entries

There are several methods to retrieve multiple entries available in the SDK.

Get and filter entries

let builder = QueryBuilder::new()
        .content_type_is("product")
        .field_equals("fields.name", name);
let products = contentful_client
        .get_entries::<Product>(Some(builder))
        .await?
Commit count: 39

cargo fmt