Skip to main content

VpsRecord

Struct VpsRecord 

Source
pub struct VpsRecord {
Show 15 fields pub name: String, pub host: String, pub port: u16, pub username: String, pub password: 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 sudo_password: Option<SecretString>, pub su_password: Option<SecretString>, pub disable_sudo: bool, pub schema_version: u32, pub added_at: String,
}
Expand description

VPS host record in the configuration file.

Wire format (serialize): English field names. Legacy Portuguese keys remain readable via serde(alias = …) (GAP-AUD-20260717-001/002/021).

Fields§

§name: String

Logical unique VPS name.

§host: String

Server hostname or IP.

§port: u16

SSH port.

§username: String

SSH username.

§password: SecretString

SSH password (empty when key-only auth).

§key_path: Option<String>

Absolute or expandable OpenSSH private key path.

§key_passphrase: Option<SecretString>

Private key passphrase (optional).

§timeout_ms: u64

Timeout in milliseconds.

§max_command_chars: usize

Command character limit (input). 0 = unlimited at runtime.

§max_output_chars: usize

Stdout/stderr character limit. Accepts legacy alias max_chars.

§sudo_password: Option<SecretString>

Password for sudo (optional).

§su_password: Option<SecretString>

Password for su - (optional).

§disable_sudo: bool

If true, sudo-exec and su-exec are rejected for this host.

§schema_version: u32

Schema version for this record.

§added_at: String

RFC 3339 inclusion timestamp.

Implementations§

Source§

impl VpsRecord

Source

pub fn new( name: String, host: String, port: u16, username: String, password: SecretString, key_path: Option<String>, key_passphrase: Option<SecretString>, timeout_ms: Option<u64>, max_command_chars: Option<usize>, max_output_chars: Option<usize>, sudo_password: Option<SecretString>, su_password: Option<SecretString>, disable_sudo: bool, ) -> Self

Creates a new record applying defaults.

Source

pub fn has_password(&self) -> bool

Returns true if there is a non-empty password.

Source

pub fn has_key(&self) -> bool

Returns true if there is a private key path.

Source

pub fn validate_credentials(&self) -> Result<(), String>

Validates that at least one authentication method exists.

Source

pub fn validate(&self) -> Result<(), String>

Full record validation at the write boundary (add/edit/import).

Ensures port ∈ 1..=65535, non-empty host/user, and credentials present. Does not check that key_path exists on the filesystem (dispatcher does).

Source

pub fn normalize_schema(&mut self)

Normalizes schema after deserialization (v1 → v2 migration).

Trait Implementations§

Source§

impl Clone for VpsRecord

Source§

fn clone(&self) -> VpsRecord

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VpsRecord

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VpsRecord

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VpsRecord

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more