Sample code for 30+ languages & platforms
Rust

Example: Http.GetCacheRoot method

Demonstrates the GetCacheRoot method.

Chilkat Rust Downloads

Rust
let http = chilkat::Http::new();

// Establish 2 cache root directories.
http.add_cache_root("c:/example/httpCacheA/");
http.add_cache_root("c:/example/httpCacheB/");

println!("Number of cache roots: {}", http.num_cache_roots());

println!("1st cache root: {}", http.get_cache_root(0).unwrap_or_default());
println!("2nd cache root: {}", http.get_cache_root(1).unwrap_or_default());

// Output:

// Number of cache roots: 2
// 1st cache root: c:/example/httpCacheA/
// 2nd cache root: c:/example/httpCacheB/