mirror of https://github.com/xvxx/phetch
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
415 B
Rust
23 lines
415 B
Rust
5 years ago
|
use ui::{Action, Key, View};
|
||
|
|
||
|
pub struct TextView {
|
||
|
url: String,
|
||
|
raw: String,
|
||
|
}
|
||
|
|
||
|
impl View for TextView {
|
||
|
fn process_input(&mut self, c: Key) -> Action {
|
||
|
Action::None
|
||
|
}
|
||
|
|
||
|
fn render(&self, width: u16, height: u16) -> String {
|
||
|
self.raw.to_string()
|
||
|
}
|
||
|
}
|
||
|
|
||
|
impl TextView {
|
||
|
pub fn from(url: String, response: String) -> TextView {
|
||
|
TextView { url, raw: response }
|
||
|
}
|
||
|
}
|