Skip to content

Latest commit

Β 

History

History
32 lines (27 loc) Β· 696 Bytes

README.md

File metadata and controls

32 lines (27 loc) Β· 696 Bytes

txts.rs

Rust library for interacting with txts

Examples

Initializing client

let host = Url::parse("https://txts.sudokoko.xyz/").unwrap();
let client = TxtsClient::new(host)?;

Getting page info

let page = client.get("username").await?;
println!("Verified: {}", page.verified);
println!("HTML: {}", page.html_content);

Getting page content in markdown

let markdown = client.get_markdown("username").await?;

Creating page

let (page, secret) = client.create("username", "content").await?;

Editing page

let secret = Uuid::parse_str("Secret here").unwrap();
let edited_page = client.edit("username", &secret, "content").await?;