pub struct Output(/* private fields */);
Expand description
Interface for text-based output devices.
It implements the fmt::Write trait, so you can use it to print text with
standard Rust constructs like the write!()
and writeln!()
macros.
§Accessing Output
protocol
The standard output and standard error output protocols can be accessed
using SystemTable::stdout
and SystemTable::stderr
, respectively.
An Output
protocol can also be accessed like any other UEFI protocol.
See the BootServices
documentation for more details of how to open a
protocol.
Implementations§
source§impl Output
impl Output
sourcepub fn reset(&mut self, extended: bool) -> Result
pub fn reset(&mut self, extended: bool) -> Result
Resets and clears the text output device hardware.
sourcepub fn clear(&mut self) -> Result
pub fn clear(&mut self) -> Result
Clears the output screen.
The background is set to the current background color. The cursor is moved to (0, 0).
sourcepub fn output_string(&mut self, string: &CStr16) -> Result
pub fn output_string(&mut self, string: &CStr16) -> Result
Writes a string to the output device.
sourcepub fn output_string_lossy(&mut self, string: &CStr16) -> Result
pub fn output_string_lossy(&mut self, string: &CStr16) -> Result
Writes a string to the output device. If the string contains unknown characters that cannot be rendered they will be silently skipped.
sourcepub fn test_string(&mut self, string: &CStr16) -> Result<bool>
pub fn test_string(&mut self, string: &CStr16) -> Result<bool>
Checks if a string contains only supported characters.
UEFI applications are encouraged to try to print a string even if it contains some unsupported characters.
sourcepub fn current_mode(&self) -> Result<Option<OutputMode>>
pub fn current_mode(&self) -> Result<Option<OutputMode>>
Returns the current text mode.
sourcepub fn set_mode(&mut self, mode: OutputMode) -> Result
pub fn set_mode(&mut self, mode: OutputMode) -> Result
Sets a mode as current.
sourcepub const fn cursor_visible(&self) -> bool
pub const fn cursor_visible(&self) -> bool
Returns whether the cursor is currently shown or not.
sourcepub fn enable_cursor(&mut self, visible: bool) -> Result
pub fn enable_cursor(&mut self, visible: bool) -> Result
Make the cursor visible or invisible.
The output device may not support this operation, in which case an
Unsupported
error will be returned.
sourcepub const fn cursor_position(&self) -> (usize, usize)
pub const fn cursor_position(&self) -> (usize, usize)
Returns the column and row of the cursor.
sourcepub fn set_cursor_position(&mut self, column: usize, row: usize) -> Result
pub fn set_cursor_position(&mut self, column: usize, row: usize) -> Result
Sets the cursor’s position, relative to the top-left corner, which is (0, 0).
This function will fail if the cursor’s new position would exceed the screen’s bounds.