pub struct Framebuffer {
pub device: File,
pub frame: MmapMut,
pub var_screen_info: VarScreeninfo,
pub fix_screen_info: FixScreeninfo,
}
Expand description
Struct that should be used to work with the framebuffer. Direct usage of frame
should not be
necessary.
Fields§
§device: File
§frame: MmapMut
§var_screen_info: VarScreeninfo
§fix_screen_info: FixScreeninfo
Implementations§
Source§impl Framebuffer
impl Framebuffer
pub fn new<P: AsRef<Path>>( path_to_device: P, ) -> Result<Framebuffer, FramebufferError>
Sourcepub fn write_frame(&mut self, frame: &[u8])
pub fn write_frame(&mut self, frame: &[u8])
Writes a frame to the Framebuffer.
Sourcepub fn read_frame(&self) -> &[u8] ⓘ
pub fn read_frame(&self) -> &[u8] ⓘ
Reads a frame from the framebuffer.
Sourcepub fn get_fix_screeninfo(
device: &File,
) -> Result<FixScreeninfo, FramebufferError>
pub fn get_fix_screeninfo( device: &File, ) -> Result<FixScreeninfo, FramebufferError>
Creates a FixScreeninfo struct and fills it using ioctl.
Sourcepub fn get_var_screeninfo(
device: &File,
) -> Result<VarScreeninfo, FramebufferError>
pub fn get_var_screeninfo( device: &File, ) -> Result<VarScreeninfo, FramebufferError>
Creates a VarScreeninfo struct and fills it using ioctl.
pub fn put_var_screeninfo( device: &File, screeninfo: &VarScreeninfo, ) -> Result<i32, FramebufferError>
pub fn pan_display( device: &File, screeninfo: &VarScreeninfo, ) -> Result<i32, FramebufferError>
Sourcepub fn set_kd_mode(kd_mode: KdMode) -> Result<i32, FramebufferError>
pub fn set_kd_mode(kd_mode: KdMode) -> Result<i32, FramebufferError>
Sets the tty graphics mode. Make sure to change it back to KdMode::Text after the program is done!
Sourcepub fn set_kd_mode_ex<P: AsRef<Path>>(
path_to_device: P,
kd_mode: KdMode,
) -> Result<i32, FramebufferError>
pub fn set_kd_mode_ex<P: AsRef<Path>>( path_to_device: P, kd_mode: KdMode, ) -> Result<i32, FramebufferError>
Allows setting tty mode from non-terminal session by explicitly specifying device name
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Framebuffer
impl RefUnwindSafe for Framebuffer
impl Send for Framebuffer
impl Sync for Framebuffer
impl Unpin for Framebuffer
impl UnwindSafe for Framebuffer
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