pub struct VpsRegistro {Show 15 fields
pub nome: String,
pub host: String,
pub porta: u16,
pub usuario: String,
pub senha: SecretString,
pub key_path: Option<String>,
pub key_passphrase: Option<SecretString>,
pub timeout_ms: u64,
pub max_command_chars: usize,
pub max_output_chars: usize,
pub senha_sudo: Option<SecretString>,
pub senha_su: Option<SecretString>,
pub disable_sudo: bool,
pub schema_version: u32,
pub adicionado_em: String,
}Expand description
Registro de uma VPS no arquivo de configuração.
Fields§
§nome: StringNome lógico único da VPS.
host: StringHostname ou IP do servidor.
porta: u16Porta SSH.
usuario: StringUsuário SSH.
senha: SecretStringSenha SSH (vazia se auth só por chave).
key_path: Option<String>Caminho absoluto ou expandível para chave privada OpenSSH.
key_passphrase: Option<SecretString>Passphrase da chave privada (opcional).
timeout_ms: u64Timeout em milissegundos.
max_command_chars: usizeLimite de caracteres do comando (entrada). 0 = ilimitado em runtime.
max_output_chars: usizeLimite de caracteres de stdout/stderr. Aceita alias legado max_chars.
senha_sudo: Option<SecretString>Senha para sudo (opcional).
senha_su: Option<SecretString>Senha para su - (opcional).
disable_sudo: boolSe true, sudo-exec e su-exec são recusados para este host.
schema_version: u32Versão do schema deste registro.
adicionado_em: StringTimestamp RFC 3339 de inclusão.
Implementations§
Source§impl VpsRegistro
impl VpsRegistro
Sourcepub fn novo(
nome: String,
host: String,
porta: u16,
usuario: String,
senha: SecretString,
key_path: Option<String>,
key_passphrase: Option<SecretString>,
timeout_ms: Option<u64>,
max_command_chars: Option<usize>,
max_output_chars: Option<usize>,
senha_sudo: Option<SecretString>,
senha_su: Option<SecretString>,
disable_sudo: bool,
) -> Self
pub fn novo( nome: String, host: String, porta: u16, usuario: String, senha: SecretString, key_path: Option<String>, key_passphrase: Option<SecretString>, timeout_ms: Option<u64>, max_command_chars: Option<usize>, max_output_chars: Option<usize>, senha_sudo: Option<SecretString>, senha_su: Option<SecretString>, disable_sudo: bool, ) -> Self
Cria um novo registro aplicando defaults.
Sourcepub fn validar_credenciais(&self) -> Result<(), String>
pub fn validar_credenciais(&self) -> Result<(), String>
Valida que existe pelo menos um método de autenticação.
Sourcepub fn normalizar_schema(&mut self)
pub fn normalizar_schema(&mut self)
Normaliza schema após deserialização (migração v1 → v2).
Trait Implementations§
Source§impl Clone for VpsRegistro
impl Clone for VpsRegistro
Source§fn clone(&self) -> VpsRegistro
fn clone(&self) -> VpsRegistro
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 VpsRegistro
impl Debug for VpsRegistro
Source§impl<'de> Deserialize<'de> for VpsRegistro
impl<'de> Deserialize<'de> for VpsRegistro
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VpsRegistro
impl RefUnwindSafe for VpsRegistro
impl Send for VpsRegistro
impl Sync for VpsRegistro
impl Unpin for VpsRegistro
impl UnsafeUnpin for VpsRegistro
impl UnwindSafe for VpsRegistro
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