pub struct PluginSessionHandle { /* private fields */ }
Expand description
Handle to send messages on behalf of the plugin
Implementations§
Source§impl PluginSessionHandle
impl PluginSessionHandle
Sourcepub fn request_properties(&self) -> Result<(), SessionError>
pub fn request_properties(&self) -> Result<(), SessionError>
Requests the current plugin properties from the server
Sourcepub async fn get_properties(&self) -> Result<Value, SessionError>
pub async fn get_properties(&self) -> Result<Value, SessionError>
Requests the current properties from tilepad waiting until the response is retrieved and returns that
Sourcepub fn set_properties<T>(&self, properties: T) -> Result<(), SessionError>where
T: Serialize,
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
Sourcepub fn set_properties_partial<T>(
&self,
properties: T,
) -> Result<(), SessionError>where
T: Serialize,
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
Sourcepub fn request_tile_properties(
&self,
tile_id: TileId,
) -> Result<(), SessionError>
pub fn request_tile_properties( &self, tile_id: TileId, ) -> Result<(), SessionError>
Requests the specified tile properties from the server
Sourcepub async fn get_tile_properties(
&self,
tile_id: TileId,
) -> Result<Value, SessionError>
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
Sourcepub fn request_visible_tiles(&self) -> Result<(), SessionError>
pub fn request_visible_tiles(&self) -> Result<(), SessionError>
Requests the list of currently visible tiles that belong to this plugin
Sourcepub async fn get_visible_tiles(&self) -> Result<Vec<TileModel>, SessionError>
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
Sourcepub fn display_indicator(
&self,
device_id: DeviceId,
tile_id: TileId,
indicator: DeviceIndicator,
duration: u32,
) -> Result<(), SessionError>
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
Sourcepub fn set_tile_properties<T>(
&self,
tile_id: TileId,
properties: T,
) -> Result<(), SessionError>where
T: Serialize,
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
Sourcepub fn set_tile_properties_partial<T>(
&self,
tile_id: TileId,
properties: T,
) -> Result<(), SessionError>where
T: Serialize,
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
Sourcepub fn set_tile_icon(
&self,
tile_id: TileId,
icon: TileIcon,
) -> Result<(), SessionError>
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
Sourcepub fn set_tile_label(
&self,
tile_id: TileId,
label: TileLabel,
) -> Result<(), SessionError>
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
Sourcepub fn send_to_inspector<T>(
&self,
ctx: InspectorContext,
msg: T,
) -> Result<(), SessionError>where
T: Serialize,
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
Trait Implementations§
Source§impl Clone for PluginSessionHandle
impl Clone for PluginSessionHandle
Source§fn clone(&self) -> PluginSessionHandle
fn clone(&self) -> PluginSessionHandle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more