docs.rs failed to build thrussh_scp-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
thrussh_scp-0.4.0
extern crate thrussh_client;
extern crate thrussh_scp;
extern crate env_logger;
use thrussh_scp::*;
use std::fs::File;
fn main() {
env_logger::init().unwrap();
let mut client = thrussh_client::SSHClient::new("localhost", 22).unwrap();
let key = thrussh_client::load_secret_key("/home/pe/.ssh/id_ed25519").unwrap();
client.session().set_auth_public_key("pe".to_string(), key);
// Run until the authentication has completed.
client.authenticate().unwrap();
// Send a file.
let contents = b"file_contents\n";
let len = contents.len();
client.send_file("/tmp", "blabla", &contents[..], len, 0o644).unwrap();
// Receive the file we just sent.
let file = File::create("blibli").unwrap();
client.receive_file("/tmp/blabla", file).unwrap();
}