[][src]Struct calloop_dbus::DBusSource

pub struct DBusSource<Data: 'static> { /* fields omitted */ }

A event source connection to D-Bus, non-async version where callbacks are Send but not Sync.

Implementations

impl<Data> DBusSource<Data>[src]

pub fn new_session() -> Result<(Self, Sender<Message>)>[src]

Create a new connection to the session bus.

pub fn new_system() -> Result<(Self, Sender<Message>)>[src]

Create a new connection to the system-wide bus.

pub fn unique_name(&self) -> BusName[src]

Get the connection's unique name.

It's usually something like ":1.54"

pub fn with_proxy<'a, 'b, Dest: Into<BusName<'a>>, BusPath: Into<Path<'a>>>(
    &'b self,
    dest: Dest,
    path: BusPath,
    timeout: Duration
) -> Proxy<'a, &'b Self>
[src]

pub fn request_name<'a, Name: Into<BusName<'a>>>(
    &self,
    name: Name,
    allow_replacement: bool,
    replace_existing: bool,
    do_not_queue: bool
) -> Result<RequestNameReply, Error>
[src]

Request a name on the D-Bus.

For detailed information on the flags and return values, see the libdbus documentation.

pub fn release_name<'a, Name: Into<BusName<'a>>>(
    &self,
    name: Name
) -> Result<ReleaseNameReply, Error>
[src]

Release a previously requested name on the D-Bus.

pub fn add_match<Args: ReadAll, Callback>(
    &self,
    match_rule: MatchRule<'static>,
    callback: Callback
) -> Result<Token, Error> where
    Callback: FnMut(Args, &Self, &Message) -> bool + Send + 'static, 
[src]

Adds a new match to the connection, and sets up a callback when this message arrives.

The returned value can be used to remove the match. The match is also removed if the callback returns "false".

pub fn add_match_data<Args: ReadAll, Callback>(
    &self,
    match_rule: MatchRule<'static>,
    callback: Callback
) -> Result<Token, Error> where
    Callback: FnMut(Args, &Self, &Message, &mut Data) -> bool + Send + 'static, 
[src]

Adds a new match to the connection, and sets up a callback when this message arrives. This callback will be able to access the calloop user data.

The returned value can be used to remove the match. The match is also removed if the callback returns "false".

pub fn remove_match(&self, id: Token) -> Result<(), Error>[src]

Removes a previously added match and callback from the connection.

pub fn process(&mut self, timeout: Duration) -> Result<bool, Error>[src]

pub fn channel(&self) -> &Channel[src]

The Channel for this connection

pub fn quick_insert(
    self,
    handle: LoopHandle<Data>,
    panic_on_orphan: bool
) -> Result<Source<DBusSource<Data>>, InsertError<DBusSource<Data>>>
[src]

Insert this source into the given event loop with an adapder that ether panics on orphan events or just logs it at warn level. You probably only what this if you set eavesdrop on a MatchRule.

Trait Implementations

impl<Data> BlockingSender for DBusSource<Data>[src]

impl<Data> EventSource for DBusSource<Data>[src]

type Event = Message

The type of events generated by your source.

type Metadata = DBusSource<Data>

Some metadata of your event source Read more

type Ret = Option<Token>

The return type of the user callback Read more

impl<Args: ReadAll, Callback: FnMut(Args, &DBusSource<Data>, &Message, &mut Data) -> bool + Send + 'static, Data> MakeDataSignal<Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) + 'static + Send>, Args, DBusSource<Data>> for Callback[src]

impl<Args: ReadAll, Callback: FnMut(Args, &DBusSource<Data>, &Message) -> bool + Send + 'static, Data> MakeSignal<Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) + 'static + Send>, Args, DBusSource<Data>> for Callback[src]

impl<Data> MatchingReceiver for DBusSource<Data>[src]

type F = Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>

Type of callback

impl<Data> Sender for DBusSource<Data>[src]

Auto Trait Implementations

impl<Data> !RefUnwindSafe for DBusSource<Data>

impl<Data> Send for DBusSource<Data>

impl<Data> !Sync for DBusSource<Data>

impl<Data> Unpin for DBusSource<Data>

impl<Data> !UnwindSafe for DBusSource<Data>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.