Skip to main content

Mensagem

Enum Mensagem 

Source
pub enum Mensagem {
Show 26 variants VpsRegistroVazio, VpsListaTitulo, VpsAdicionada { nome: String, }, VpsRemovida { nome: String, }, VpsDuplicada { nome: String, }, VpsNaoEncontrada { nome: String, }, VpsAtivaSelecionada { nome: String, }, ConfigCaminhoLabel, ConfigCaminho { caminho: String, }, ConfigSemChaves, ErroCarregarConfig, ErroSalvarConfig, ErroConexaoSsh, ErroComandoFalhou, ErroArgumentoInvalido { detalhe: String, }, ErroGenerico { detalhe: String, }, TunnelAtivo { porta_local: u16, host_remoto: String, porta_remota: u16, vps_nome: String, }, TunnelPressioneCtrlC, HealthCheckOk { nome: String, }, HealthCheckSemVps, HealthCheckFalhou { nome: String, detalhe: String, }, HealthCheckLatencia { nome: String, latencia_ms: u64, }, OperacaoCancelada, ConfirmarRemocaoVps { nome: String, }, RemocaoCancelada, RemoveExigeYesEmNaoInterativo,
}
Expand description

Todas as mensagens de UI do sistema.

ÚNICA fonte de strings visíveis ao usuário. Cada variante possui tradução exaustiva em en() e pt(). PROIBIDO usar string literal de UI fora deste enum.

Variantes com campos dinâmicos (ex.: { nome: String }) permitem incluir dados contextuais na mensagem. Mensagem não implementa Copy pois campos String não são Copy.

Variants§

§

VpsRegistroVazio

Nenhuma VPS cadastrada no arquivo de configuração.

§

VpsListaTitulo

Cabeçalho da listagem de VPS registradas.

§

VpsAdicionada

VPS adicionada com sucesso ao registro.

Fields

§nome: String

Nome da VPS adicionada.

§

VpsRemovida

VPS removida com sucesso do registro.

Fields

§nome: String

Nome da VPS removida.

§

VpsDuplicada

Tentativa de adicionar VPS já existente no registro.

Fields

§nome: String

Nome da VPS duplicada.

§

VpsNaoEncontrada

VPS solicitada não foi encontrada no registro.

Fields

§nome: String

Nome da VPS não encontrada.

§

VpsAtivaSelecionada

VPS ativa selecionada para operações subsequentes.

Fields

§nome: String

Nome da VPS selecionada.

§

ConfigCaminhoLabel

Rótulo do caminho do arquivo de configuração.

§

ConfigCaminho

Caminho atual do arquivo de configuração.

Fields

§caminho: String

Caminho absoluto do arquivo de configuração.

§

ConfigSemChaves

Nenhuma chave de API configurada no sistema.

§

ErroCarregarConfig

Falha ao carregar o arquivo de configuração.

§

ErroSalvarConfig

Falha ao salvar o arquivo de configuração.

§

ErroConexaoSsh

Erro ao estabelecer conexão SSH com o servidor remoto.

§

ErroComandoFalhou

Falha na execução de comando remoto via SSH.

§

ErroArgumentoInvalido

Argumento inválido fornecido à operação.

Fields

§detalhe: String

Detalhe do argumento inválido.

§

ErroGenerico

Erro genérico com descrição textual.

Fields

§detalhe: String

Descrição do erro.

§

TunnelAtivo

Tunnel SSH ativo com informações de porta e host.

Fields

§porta_local: u16

Porta local do tunnel.

§host_remoto: String

Host remoto destino.

§porta_remota: u16

Porta remota destino.

§vps_nome: String

Nome da VPS usada como relay.

§

TunnelPressioneCtrlC

Instrução para encerrar o tunnel via Ctrl+C.

§

HealthCheckOk

Verificação de conectividade com VPS bem-sucedida.

Fields

§nome: String

Nome da VPS verificada.

§

HealthCheckSemVps

Nenhuma VPS ativa selecionada para health check.

§

HealthCheckFalhou

Falha na verificação de conectividade com VPS.

Fields

§nome: String

Nome da VPS verificada.

§detalhe: String

Detalhe do erro.

§

HealthCheckLatencia

Resultado de health check com latência.

Fields

§nome: String

Nome da VPS verificada.

§latencia_ms: u64

Latência em milissegundos.

§

OperacaoCancelada

Operação cancelada por sinal do usuário (Ctrl+C ou SIGTERM).

§

ConfirmarRemocaoVps

Pergunta de confirmação para remoção de VPS.

Fields

§nome: String

Nome da VPS a ser removida.

§

RemocaoCancelada

Mensagem informando que a remoção foi cancelada pelo usuário.

§

RemoveExigeYesEmNaoInterativo

Erro exigindo flag --yes em modo não-interativo.

Implementations§

Source§

impl Mensagem

Source

pub fn texto(&self, idioma: Idioma) -> String

Retorna a string da mensagem no idioma especificado.

Método determinístico para uso em testes — não depende de estado global.

Trait Implementations§

Source§

impl Clone for Mensagem

Source§

fn clone(&self) -> Mensagem

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 Mensagem

Source§

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

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

impl Eq for Mensagem

Source§

impl PartialEq for Mensagem

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Mensagem

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