1 unstable release
0.1.3 | Jun 12, 2024 |
---|---|
0.1.2 |
|
0.1.1 |
|
0.1.0 |
|
#51 in #entry
224 downloads per month
27KB
574 lines
Contentful Management
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.
Installation
To include the contentful_management library in your project, add the following to your Cargo.toml file:
[dependencies]
contentful_management = "0.1"
Usage
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);
}
}
}
Dependencies
~4–15MB
~200K SLoC