Plugin

Trait Plugin 

Source
pub trait Plugin {
    // Provided methods
    fn on_registered(&mut self, session: &PluginSessionHandle) { ... }
    fn on_properties(
        &mut self,
        session: &PluginSessionHandle,
        properties: Value,
    ) { ... }
    fn on_tile_properties(
        &mut self,
        session: &PluginSessionHandle,
        tile_id: TileId,
        properties: Value,
    ) { ... }
    fn on_inspector_message(
        &mut self,
        session: &PluginSessionHandle,
        inspector: Inspector,
        message: Value,
    ) { ... }
    fn on_display_message(
        &mut self,
        session: &PluginSessionHandle,
        display: Display,
        message: Value,
    ) { ... }
    fn on_inspector_open(
        &mut self,
        session: &PluginSessionHandle,
        inspector: Inspector,
    ) { ... }
    fn on_inspector_close(
        &mut self,
        session: &PluginSessionHandle,
        inspector: Inspector,
    ) { ... }
    fn on_deep_link(
        &mut self,
        session: &PluginSessionHandle,
        ctx: DeepLinkContext,
    ) { ... }
    fn on_tile_clicked(
        &mut self,
        session: &PluginSessionHandle,
        ctx: TileInteractionContext,
        properties: Value,
    ) { ... }
    fn on_device_tiles(
        &mut self,
        session: &PluginSessionHandle,
        device_id: DeviceId,
        tiles: Vec<TileModel>,
    ) { ... }
    fn on_visible_tiles(
        &mut self,
        session: &PluginSessionHandle,
        tiles: Vec<TileModel>,
    ) { ... }
}
Expand description

Trait implemented by your plugin

Provided Methods§

Source

fn on_registered(&mut self, session: &PluginSessionHandle)

Invoked when the plugin is successfully registered with the Tilepad application and has a usable session

§Arguments
  • session - The current session
Source

fn on_properties(&mut self, session: &PluginSessionHandle, properties: Value)

Invoked when the plugin properties are received from Tilepad, this will occur when the plugin calls session.request_properties or session.get_properties but also once when the plugin is first registered

§Arguments
  • session - The current session
  • properties - The current plugin properties
Source

fn on_tile_properties( &mut self, session: &PluginSessionHandle, tile_id: TileId, properties: Value, )

Invoked when a tiles properties are received from Tilepad, this will occur when the plugin calls PluginSessionHandle::request_tile_properties or PluginSessionHandle::get_tile_properties

§Arguments
  • session - The current session
  • tile_id - ID of the tile that the properties are for
  • properties - The current plugin properties
Source

fn on_inspector_message( &mut self, session: &PluginSessionHandle, inspector: Inspector, message: Value, )

Invoked when the plugin receives a message from the inspector, this message structure is defined by the developer

§Arguments
  • session - The current session
  • `inspector - Inspector to send messages back
  • message - The message sent from the inspector
Source

fn on_display_message( &mut self, session: &PluginSessionHandle, display: Display, message: Value, )

Invoked when the plugin receives a message from a display, this message structure is defined by the developer

§Arguments
  • session - The current session
  • display - Display to send messages back
  • message - The message sent from the inspector
Source

fn on_inspector_open( &mut self, session: &PluginSessionHandle, inspector: Inspector, )

Invoked when the inspector is opened for a tile

§Arguments
  • session - The current session
  • `inspector - Inspector to send messages back
Source

fn on_inspector_close( &mut self, session: &PluginSessionHandle, inspector: Inspector, )

Invoked when the inspector is closed for a tile

§Arguments
  • session - The current session
  • `inspector - Inspector to send messages back

Invoked when a deep link is received for the plugin

§Arguments
  • session - The current session
  • ctx - Information about the deep-link
Source

fn on_tile_clicked( &mut self, session: &PluginSessionHandle, ctx: TileInteractionContext, properties: Value, )

Invoked when a tile is clicked on a device

§Arguments
  • session - The current session
  • ctx - Contextual information about tile clicked tile (Device, action, etc)
  • properties - The current tile properties at the time of clicking
Source

fn on_device_tiles( &mut self, session: &PluginSessionHandle, device_id: DeviceId, tiles: Vec<TileModel>, )

Invoked when the visible tiles on a device change

§Arguments
  • session - The current session
  • device_id - ID of the device the tiles are for
  • tiles - The current tiles of the device
Source

fn on_visible_tiles( &mut self, session: &PluginSessionHandle, tiles: Vec<TileModel>, )

Invoked when the list of visible tiles is received this will occur when the plugin calls PluginSessionHandle::request_visible_tiles or PluginSessionHandle::get_visible_tiles

§Arguments
  • session - The current session
  • tiles - The current visible tiles

Implementors§