Struct Client

Source
pub struct Client(/* private fields */);
Expand description

An interface to the frontend.

Implementations§

Source§

impl Client

Source

pub fn new(peer: RpcPeer) -> Self

Source

pub fn update_view(&self, view_id: ViewId, update: &Update)

Source

pub fn scroll_to(&self, view_id: ViewId, line: usize, col: usize)

Source

pub fn config_changed(&self, view_id: ViewId, changes: &Table)

Source

pub fn available_themes(&self, theme_names: Vec<String>)

Source

pub fn available_languages(&self, languages: Vec<LanguageId>)

Source

pub fn theme_changed(&self, name: &str, theme: &ThemeSettings)

Source

pub fn language_changed(&self, view_id: ViewId, new_lang: &LanguageId)

Source

pub fn plugin_started(&self, view_id: ViewId, plugin: &str)

Notify the client that a plugin has started.

Source

pub fn plugin_stopped(&self, view_id: ViewId, plugin: &str, code: i32)

Notify the client that a plugin has stopped.

code is not currently used; in the future may be used to pass an exit code.

Source

pub fn available_plugins(&self, view_id: ViewId, plugins: &[ClientPluginInfo])

Notify the client of the available plugins.

Source

pub fn update_cmds(&self, view_id: ViewId, plugin: &str, cmds: &[Command])

Source

pub fn def_style(&self, style: &Value)

Source

pub fn find_status(&self, view_id: ViewId, queries: &Value)

Source

pub fn replace_status(&self, view_id: ViewId, replace: &Value)

Source

pub fn measure_width(&self, reqs: &[WidthReq]) -> Result<WidthResponse, Error>

Ask front-end to measure widths of strings.

Source

pub fn alert<S: AsRef<str>>(&self, msg: S)

Source

pub fn add_status_item( &self, view_id: ViewId, source: &str, key: &str, value: &str, alignment: &str, )

Source

pub fn update_status_item(&self, view_id: ViewId, key: &str, value: &str)

Source

pub fn remove_status_item(&self, view_id: ViewId, key: &str)

Source

pub fn show_hover(&self, view_id: ViewId, request_id: usize, result: String)

Source

pub fn schedule_idle(&self, token: usize)

Source

pub fn schedule_timer(&self, timeout: Instant, token: usize)

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.