Expand description
HackMD API client for Rust.
Async client for the HackMD HTTP API (mirrors @hackmd/api).
§Quick start
let client = hackmd::Client::new(std::env::var("HMD_API_ACCESS_TOKEN").unwrap())?;
let me = client.me().await?;
println!("hello {}", me.name);
// List the authenticated user's notes (may be empty).
let notes = client.notes().await?;
for n in ¬es {
println!("- {} ({})", n.title, n.id);
}Requires a tokio runtime.
§Feature flags
cli(default) — builds thehackmdbinary and theclimodule.tui— enables thehackmd tuisubcommand (impliescli).
With default-features = false you get a pure async SDK with no clap /
comfy-table / etc. dependencies pulled into the binary.
Re-exports§
pub use client::CachedResponse;pub use client::Client;pub use client::ClientConfig;pub use client::DEFAULT_ENDPOINT;pub use client::RetryConfig;pub use error::Error;pub use error::Result;pub use types::ApiFolder;pub use types::ApiFolderOrder;pub use types::CommentPermissionType;pub use types::CreateNoteOptions;pub use types::CreateTeamFolderBody;pub use types::CreateUserFolderBody;pub use types::FolderPath;pub use types::Note;pub use types::NotePermissionRole;pub use types::NotePublishType;pub use types::SimpleUserProfile;pub use types::SingleNote;pub use types::Team;pub use types::TeamVisibilityType;pub use types::UpdateFolderOrderBody;pub use types::UpdateNoteOptions;pub use types::UpdateTeamFolderBody;pub use types::UpdateUserFolderBody;pub use types::User;