Update Metadata to be cloneable, debuggable, serializable, and deserializable; remove unused ssh2 feature deps from core

pull/59/head
Chip Senkbeil 3 years ago
parent e586891463
commit fd2a5a985c
No known key found for this signature in database
GPG Key ID: 35EF1F8EC72A4131

2
Cargo.lock generated

@ -466,11 +466,9 @@ dependencies = [
"once_cell",
"predicates",
"rand",
"rpassword",
"serde",
"serde_cbor",
"serde_json",
"ssh2",
"structopt",
"strum",
"tokio",

@ -10,9 +10,6 @@ repository = "https://github.com/chipsenkbeil/distant"
readme = "README.md"
license = "MIT OR Apache-2.0"
[features]
native-ssh2 = ["rpassword", "ssh2"]
[dependencies]
bytes = "1.1.0"
chacha20poly1305 = "0.9.0"
@ -31,8 +28,6 @@ tokio-util = { version = "0.6.7", features = ["codec"] }
walkdir = "2.3.2"
# Optional dependencies based on features
rpassword = { version = "5.0.1", optional = true }
ssh2 = { version = "0.9.1", features = ["vendored-openssl"], optional = true }
structopt = { version = "0.3.22", optional = true }
[dev-dependencies]

@ -4,6 +4,7 @@ use crate::{
net::TransportError,
};
use derive_more::{Display, Error, From};
use serde::{Deserialize, Serialize};
use std::{future::Future, path::PathBuf, pin::Pin};
/// Represents an error that can occur related to convenience functions tied to a
@ -24,6 +25,7 @@ pub type AsyncReturn<'a, T, E = SessionChannelExtError> =
Pin<Box<dyn Future<Output = Result<T, E>> + Send + 'a>>;
/// Represents metadata about some path on a remote machine
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct Metadata {
pub file_type: FileType,
pub len: u64,

Loading…
Cancel
Save