pub struct TextView;Expand description
View for rendering run command output as human-readable text
This view displays service URLs and configuration hints after services have been started. It uses shared view components for consistency across commands.
§Examples
use torrust_tracker_deployer_lib::application::command_handlers::show::info::ServiceInfo;
use torrust_tracker_deployer_lib::presentation::cli::views::commands::run::{TextView, RunDetailsData};
let services = ServiceInfo::new(
vec!["udp://10.0.0.1:6969/announce".to_string()],
vec![],
vec!["http://10.0.0.1:7070/announce".to_string()],
vec![],
"http://10.0.0.1:1212/api".to_string(),
false,
false,
"http://10.0.0.1:1313/health_check".to_string(),
false,
false,
vec![],
);
let data = RunDetailsData::new("my-env".to_string(), services, None);
let output = TextView::render(&data).unwrap();
assert!(output.contains("Services are now accessible:"));
assert!(output.contains("Tip:"));Trait Implementations§
Source§impl Render<RunDetailsData> for TextView
impl Render<RunDetailsData> for TextView
Source§fn render(data: &RunDetailsData) -> Result<String, ViewRenderError>
fn render(data: &RunDetailsData) -> Result<String, ViewRenderError>
Render
data into a string representation. Read moreAuto Trait Implementations§
impl Freeze for TextView
impl RefUnwindSafe for TextView
impl Send for TextView
impl Sync for TextView
impl Unpin for TextView
impl UnsafeUnpin for TextView
impl UnwindSafe for TextView
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request