PluginSessionHandle

Struct PluginSessionHandle 

Source
pub struct PluginSessionHandle { /* private fields */ }
Expand description

Handle to send messages on behalf of the plugin

Implementations§

Source§

impl PluginSessionHandle

Source

pub fn request_properties(&self) -> Result<(), SessionError>

Requests the current plugin properties from the server

Source

pub async fn get_properties(&self) -> Result<Value, SessionError>

Requests the current properties from tilepad waiting until the response is retrieved and returns that

Source

pub fn set_properties<T>(&self, properties: T) -> Result<(), SessionError>
where T: Serialize,

Sets the properties for the plugin

This replaces the stored properties object with the provided properties.

Use PluginSessionHandle::set_properties_partial to perform a partial update

Source

pub fn set_properties_partial<T>( &self, properties: T, ) -> Result<(), SessionError>
where T: Serialize,

Sets the properties for the plugin

This performs a partial update, merging the existing plugin properties with the specified properties

Use PluginSessionHandle::set_properties to replace the properties completely

Source

pub fn request_tile_properties( &self, tile_id: TileId, ) -> Result<(), SessionError>

Requests the specified tile properties from the server

Source

pub async fn get_tile_properties( &self, tile_id: TileId, ) -> Result<Value, SessionError>

Requests the current properties for a tile from tilepad waiting until the response is retrieved and returns that

Source

pub fn request_visible_tiles(&self) -> Result<(), SessionError>

Requests the list of currently visible tiles that belong to this plugin

Source

pub async fn get_visible_tiles(&self) -> Result<Vec<TileModel>, SessionError>

Requests the current properties for a tile from tilepad waiting until the response is retrieved and returns that

Source

pub fn display_indicator( &self, device_id: DeviceId, tile_id: TileId, indicator: DeviceIndicator, duration: u32, ) -> Result<(), SessionError>

Display an indicator on a specific tile on the device

Will display the indicator on device_id on the specific tile_id it will display an indicator of style indicator for duration milliseconds

Source

pub fn set_tile_properties<T>( &self, tile_id: TileId, properties: T, ) -> Result<(), SessionError>
where T: Serialize,

Sets the properties for the specified tile

You can only update tiles that are using an action from your plugin

This replaces the stored properties object with the provided properties.

Use PluginSessionHandle::set_tile_properties_partial to perform a partial update

Source

pub fn set_tile_properties_partial<T>( &self, tile_id: TileId, properties: T, ) -> Result<(), SessionError>
where T: Serialize,

Sets the properties for the specified tile

You can only update tiles that are using an action from your plugin

This performs a partial update, merging the existing plugin properties with the specified properties

Use PluginSessionHandle::set_tile_properties to replace the properties completely

Source

pub fn set_tile_icon( &self, tile_id: TileId, icon: TileIcon, ) -> Result<(), SessionError>

Sets the icon for a specific tile

You can only update tiles that are using an action from your plugin

Source

pub fn set_tile_label( &self, tile_id: TileId, label: TileLabel, ) -> Result<(), SessionError>

Sets the label for a specific tile

You can only update tiles that are using an action from your plugin

Source

pub fn send_to_inspector<T>( &self, ctx: InspectorContext, msg: T, ) -> Result<(), SessionError>
where T: Serialize,

Sends a message to the plugin inspector UI at the provided inspector context

Source

pub fn open_url(&self, url: String) -> Result<(), SessionError>

Tells tilepad to open the provided url in the default browser

Trait Implementations§

Source§

impl Clone for PluginSessionHandle

Source§

fn clone(&self) -> PluginSessionHandle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more