pub struct Client { /* private fields */ }Expand description
A simple 9p client for ad
Implementations§
Source§impl Client
impl Client
Sourcepub fn new_for_pid(pid: &str) -> Result<Self>
pub fn new_for_pid(pid: &str) -> Result<Self>
Create a new client connected to the ad session with the given pid
over it’s 9p unix socket.
When running under ad, the Client::new method will automatically find and connect to it’s parent session.
Sourcepub fn log_events(
&mut self,
) -> Result<impl Iterator<Item = Result<LogEvent>> + use<>>
pub fn log_events( &mut self, ) -> Result<impl Iterator<Item = Result<LogEvent>> + use<>>
Iterate over the log events emitted by ad
Sourcepub fn current_buffer(&mut self) -> Result<String>
pub fn current_buffer(&mut self) -> Result<String>
Get the currently active buffer id.
Sourcepub fn read_dot(&mut self, buffer: &str) -> Result<String>
pub fn read_dot(&mut self, buffer: &str) -> Result<String>
Read the contents of the dot of the given buffer
Sourcepub fn read_addr(&mut self, buffer: &str) -> Result<String>
pub fn read_addr(&mut self, buffer: &str) -> Result<String>
Read the current dot address of the given buffer.
Sourcepub fn read_filename(&mut self, buffer: &str) -> Result<String>
pub fn read_filename(&mut self, buffer: &str) -> Result<String>
Read the filename of the given buffer
Sourcepub fn read_xaddr(&mut self, buffer: &str) -> Result<String>
pub fn read_xaddr(&mut self, buffer: &str) -> Result<String>
Read the x-address of the given buffer.
This is only used by the filesystem interface of ad and will not affect the current
editor state.
Sourcepub fn read_xdot(&mut self, buffer: &str) -> Result<String>
pub fn read_xdot(&mut self, buffer: &str) -> Result<String>
Read the x-dot of the given buffer.
This is only used by the filesystem interface of ad and will not affect the current
editor state.
Sourcepub fn write_dot(&mut self, buffer: &str, content: &str) -> Result<usize>
pub fn write_dot(&mut self, buffer: &str, content: &str) -> Result<usize>
Replace the dot of the given buffer with the provided string.
Sourcepub fn append_to_body(&mut self, buffer: &str, content: &str) -> Result<usize>
pub fn append_to_body(&mut self, buffer: &str, content: &str) -> Result<usize>
Append the provided string to the given buffer.
Sourcepub fn write_addr(&mut self, buffer: &str, addr: &str) -> Result<usize>
pub fn write_addr(&mut self, buffer: &str, addr: &str) -> Result<usize>
Set the addr of the given buffer.
Sourcepub fn write_xdot(&mut self, buffer: &str, content: &str) -> Result<usize>
pub fn write_xdot(&mut self, buffer: &str, content: &str) -> Result<usize>
Replace the xdot of the given buffer with the provided string.
Sourcepub fn write_xaddr(&mut self, buffer: &str, content: &str) -> Result<usize>
pub fn write_xaddr(&mut self, buffer: &str, content: &str) -> Result<usize>
Set the xaddr of the given buffer.
Sourcepub fn echo(&mut self, msg: impl AsRef<str>) -> Result<()>
pub fn echo(&mut self, msg: impl AsRef<str>) -> Result<()>
Echo a string message in the status line.
Sourcepub fn open_in_new_window(&mut self, path: impl AsRef<str>) -> Result<()>
pub fn open_in_new_window(&mut self, path: impl AsRef<str>) -> Result<()>
Open the requested file in a new window.
Sourcepub fn reload_current_buffer(&mut self) -> Result<()>
pub fn reload_current_buffer(&mut self) -> Result<()>
Reload the currently active buffer.
Sourcepub fn run_event_filter<F>(&mut self, buffer: &str, filter: F) -> Result<()>where
F: EventFilter,
pub fn run_event_filter<F>(&mut self, buffer: &str, filter: F) -> Result<()>where
F: EventFilter,
Run a provided EventFilter until it exits or errors
Sourcepub fn body_writer(&self, bufid: &str) -> Result<BodyWriter>
pub fn body_writer(&self, bufid: &str) -> Result<BodyWriter>
Create a Write impl that can be used to continuously write to the given path
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)