Struct skylane::client::Bundle [] [src]

pub struct Bundle { /* fields omitted */ }

Bundle is passed to objects while invocation of their methods and can be used by them to add/remove new objects or access socket. It also serves this crate internally as data store.

Methods

impl Bundle
[src]

Returns connection socket.

Returns next available client object ID.

If no objects are registered this will be DISPLAY_ID. Otherwise ID one bigger than the biggest ID.

Adds new object. From now client requests or server events to object with given id will be passed to this object. If another object is already assigned to this id the assignment will be overridden.

Here the only requirement for the object is to implement Object trait. In practical use one will pass implementations of Interface traits from protocol definitions wrapped in Handler structure with Dispatcher attached as defined in skylane_protocols crate.

Gets next available client object ID and adds new object. Returns ID of newly added object.

Removes object with given id.