pub struct SftpConnectionConfig {
pub host: String,
pub port: u16,
pub username: String,
pub auth: SftpAuth,
pub known_hosts: HostKeyPolicy,
}Expand description
Shared SFTP connection configuration.
Fields§
§host: StringServer hostname or IP address.
port: u16Server port (default: 22).
username: StringSSH username.
auth: SftpAuthAuthentication method ({ type, config }).
known_hosts: HostKeyPolicyHost-key verification policy (default: accept_new).
Implementations§
Source§impl SftpConnectionConfig
impl SftpConnectionConfig
Sourcepub fn with_password(
host: impl Into<String>,
username: impl Into<String>,
password: impl Into<String>,
) -> SftpConnectionConfig
pub fn with_password( host: impl Into<String>, username: impl Into<String>, password: impl Into<String>, ) -> SftpConnectionConfig
Build a config with password authentication and default host-key policy.
Sourcepub fn port(self, port: u16) -> SftpConnectionConfig
pub fn port(self, port: u16) -> SftpConnectionConfig
Set the port.
Sourcepub fn known_hosts(self, policy: HostKeyPolicy) -> SftpConnectionConfig
pub fn known_hosts(self, policy: HostKeyPolicy) -> SftpConnectionConfig
Set the host-key policy.
Trait Implementations§
Source§impl Clone for SftpConnectionConfig
impl Clone for SftpConnectionConfig
Source§fn clone(&self) -> SftpConnectionConfig
fn clone(&self) -> SftpConnectionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SftpConnectionConfig
impl Debug for SftpConnectionConfig
Source§impl<'de> Deserialize<'de> for SftpConnectionConfig
impl<'de> Deserialize<'de> for SftpConnectionConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SftpConnectionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SftpConnectionConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for SftpConnectionConfig
impl JsonSchema for SftpConnectionConfig
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Serialize for SftpConnectionConfig
impl Serialize for SftpConnectionConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for SftpConnectionConfig
impl RefUnwindSafe for SftpConnectionConfig
impl Send for SftpConnectionConfig
impl Sync for SftpConnectionConfig
impl Unpin for SftpConnectionConfig
impl UnsafeUnpin for SftpConnectionConfig
impl UnwindSafe for SftpConnectionConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more