Trait runa_core::globals::Bind

source ·
pub trait Bind<Ctx> {
    type BindFut<'a>: Future<Output = Result<()>> + 'a
       where Ctx: 'a,
             Self: 'a;

    // Required method
    fn bind<'a>(
        &'a self,
        client: &'a mut Ctx,
        object_id: u32
    ) -> Self::BindFut<'a>;
}
Expand description

Bind a global to a client

TODO: authorization support, i.e. some globals should only be accessible to authorized clients.

Required Associated Types§

source

type BindFut<'a>: Future<Output = Result<()>> + 'a where Ctx: 'a, Self: 'a

Type of future returned by bind.

Required Methods§

source

fn bind<'a>(&'a self, client: &'a mut Ctx, object_id: u32) -> Self::BindFut<'a>

Setup a proxy of this global, the proxy object has already been inserted into the client’s object store, with the given object id.

If Err() is returned, an protocol error will be sent to the client, and the client will be disconnected.

Implementors§

source§

impl<Ctx: Client> Bind<Ctx> for Display

§

type BindFut<'a> where Self: 'a, Ctx: 'a = impl Future<Output = Result<(), Error>> + 'a

source§

impl<Ctx: Client> Bind<Ctx> for Registry

§

type BindFut<'a> where Self: 'a, Ctx: 'a = impl Future<Output = Result<(), Error>> + 'a