Crates.io | contentful_management |
lib.rs | contentful_management |
version | 0.1.3 |
source | src |
created_at | 2024-05-20 19:30:53.919606 |
updated_at | 2024-06-12 07:04:03.083541 |
description | A Rust SDK for managing entities in Contentful. |
homepage | |
repository | https://github.com/neonwarp/contentful-management |
max_upload_size | |
id | 1246101 |
size | 94,942 |
contentful_management is a Rust library designed for seamless interaction with the Contentful Content Management API. This SDK facilitates the management of entries, assets, spaces, and environments within your Contentful space, supporting operations such as fetching, creating, updating, and deleting content. It is an ideal choice for integrating Contentful into your Rust applications.
To include the contentful_management library in your project, add the following to your Cargo.toml file:
[dependencies]
contentful_management = "0.1"
Below is an example of how to create a client and fetch a single entry using this library:
use contentful_management::ContentfulClient;
use tokio;
#[tokio::main]
async fn main() {
let access_token = "your_access_token";
let space_id = "your_space_id";
let environment_id = "your_environment_id";
let client = ContentfulClient::new(access_token);
match client.entry.get(&space_id, &environment_id, "entry_id").await {
Ok(entry) => {
println!("Single Entry: {:?}", entry);
}
Err(e) => {
eprintln!("Error: {}", e);
}
}
}