Skip to main content

Message

Enum Message 

Source
pub enum Message {
Show 33 variants VpsRegistryEmpty, VpsListTitle, VpsAdded { name: String, }, VpsRemoved { name: String, }, VpsDuplicate { name: String, }, VpsNotFound { name: String, }, VpsActiveSelected { name: String, }, ConfigPathLabel, ConfigPath { path: String, }, ConfigNoKeys, ErrorLoadConfig, ErrorSaveConfig, ErrorSshConnection, ErrorCommandFailed, ErrorInvalidArgument { detail: String, }, ErrorGeneric { detail: String, }, VpsEdited { name: String, }, ExportCompleted { path: String, }, ImportCompleted, PrimaryKeyReady { source: String, key_file: String, }, ReencryptCompleted { hosts: usize, }, Success { detail: String, }, TunnelActive { local_port: u16, remote_host: String, remote_port: u16, vps_name: String, }, TunnelPressCtrlC, HealthCheckOk { name: String, }, HealthCheckNoVps, HealthCheckFailed { name: String, detail: String, }, HealthCheckLatency { name: String, latency_ms: u64, }, OperationCancelled, ScpUploadCompleted { bytes: u64, ms: u64, }, ScpDownloadCompleted { bytes: u64, ms: u64, }, ScpUploadFileOnly, ScpDownloadLocalNotDirectory,
}
Expand description

All system UI messages.

SINGLE source of user-visible strings. Each variant has an exhaustive translation in en() and pt(). FORBIDDEN to use UI literals outside this enum.

Variants with dynamic fields (e.g. { name: String }) allow including contextual data in the message. Message is not Copy because String fields are not Copy.

Variants§

§

VpsRegistryEmpty

No VPS registered in the configuration file.

§

VpsListTitle

Header for the registered VPS listing.

§

VpsAdded

VPS successfully added to the registry.

Fields

§name: String

Name of the added VPS.

§

VpsRemoved

VPS successfully removed from the registry.

Fields

§name: String

Name of the removed VPS.

§

VpsDuplicate

Attempt to add a VPS that already exists.

Fields

§name: String

Name of the duplicate VPS.

§

VpsNotFound

Requested VPS was not found in the registry.

Fields

§name: String

Name of the missing VPS.

§

VpsActiveSelected

Active VPS selected for subsequent operations.

Fields

§name: String

Name of the selected VPS.

§

ConfigPathLabel

Label for the configuration file path.

§

ConfigPath

Current configuration file path.

Fields

§path: String

Absolute configuration file path.

§

ConfigNoKeys

No API keys configured in the system.

§

ErrorLoadConfig

Failed to load the configuration file.

§

ErrorSaveConfig

Failed to save the configuration file.

§

ErrorSshConnection

Error establishing SSH connection to the remote server.

§

ErrorCommandFailed

Remote SSH command execution failed.

§

ErrorInvalidArgument

Invalid argument supplied to the operation.

Fields

§detail: String

Detail of the invalid argument.

§

ErrorGeneric

Generic error with a textual description.

Fields

§detail: String

Error description.

§

VpsEdited

VPS record edited successfully.

Fields

§name: String

VPS name.

§

ExportCompleted

Export completed.

Fields

§path: String

Destination path.

§

ImportCompleted

Import completed.

§

PrimaryKeyReady

Primary key ready.

Fields

§source: String

Key source identifier.

§key_file: String

Key file path.

§

ReencryptCompleted

Re-encrypt completed.

Fields

§hosts: usize

Host count.

§

Success

Generic human success line (already localized payload).

Fields

§detail: String

Success text.

§

TunnelActive

Active SSH tunnel with port and host information.

Fields

§local_port: u16

Local tunnel port.

§remote_host: String

Remote destination host.

§remote_port: u16

Remote destination port.

§vps_name: String

Name of the VPS used as relay.

§

TunnelPressCtrlC

Instruction to stop the tunnel via Ctrl+C.

§

HealthCheckOk

Successful VPS connectivity check.

Fields

§name: String

Name of the checked VPS.

§

HealthCheckNoVps

No active VPS selected for health check.

§

HealthCheckFailed

VPS connectivity check failed.

Fields

§name: String

Name of the checked VPS.

§detail: String

Error detail.

§

HealthCheckLatency

Health-check result with latency.

Fields

§name: String

Name of the checked VPS.

§latency_ms: u64

Latency in milliseconds.

§

OperationCancelled

Operation cancelled by user signal (Ctrl+C or SIGTERM).

§

ScpUploadCompleted

SCP upload completed.

Fields

§bytes: u64

Bytes transferred.

§ms: u64

Duration in milliseconds.

§

ScpDownloadCompleted

SCP download completed.

Fields

§bytes: u64

Bytes transferred.

§ms: u64

Duration in milliseconds.

§

ScpUploadFileOnly

Upload refused: local path is a directory (file-only, no -r).

§

ScpDownloadLocalNotDirectory

Download refused: local path is already a directory.

Implementations§

Source§

impl Message

Source

pub fn text(&self, language: Language) -> String

Returns the message string in the specified language.

Deterministic method for tests — does not depend on global state.

Trait Implementations§

Source§

impl Clone for Message

Source§

fn clone(&self) -> Message

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 Message

Source§

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

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

impl Eq for Message

Source§

impl PartialEq for Message

Source§

fn eq(&self, other: &Message) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Message

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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