[−][src]Struct calloop_dbus::DBusSource
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]
&'b self,
dest: Dest,
path: BusPath,
timeout: Duration
) -> Proxy<'a, &'b Self>
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]
&self,
name: Name,
allow_replacement: bool,
replace_existing: bool,
do_not_queue: bool
) -> Result<RequestNameReply, Error>
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]
&self,
name: Name
) -> Result<ReleaseNameReply, Error>
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]
&self,
match_rule: MatchRule<'static>,
callback: Callback
) -> Result<Token, Error> where
Callback: FnMut(Args, &Self, &Message) -> bool + Send + 'static,
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]
&self,
match_rule: MatchRule<'static>,
callback: Callback
) -> Result<Token, Error> where
Callback: FnMut(Args, &Self, &Message, &mut Data) -> bool + Send + 'static,
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]
self,
handle: LoopHandle<Data>,
panic_on_orphan: bool
) -> Result<Source<DBusSource<Data>>, InsertError<DBusSource<Data>>>
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]
fn send_with_reply_and_block(
&self,
msg: Message,
timeout: Duration
) -> Result<Message, Error>
[src]
&self,
msg: Message,
timeout: Duration
) -> Result<Message, Error>
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
fn process_events<Callback>(
&mut self,
readiness: Readiness,
token: Token,
callback: Callback
) -> Result<()> where
Callback: FnMut(Self::Event, &mut Self::Metadata) -> Self::Ret,
[src]
&mut self,
readiness: Readiness,
token: Token,
callback: Callback
) -> Result<()> where
Callback: FnMut(Self::Event, &mut Self::Metadata) -> Self::Ret,
fn register(&mut self, poll: &mut Poll, token: Token) -> Result<()>
[src]
fn reregister(&mut self, poll: &mut Poll, token: Token) -> Result<()>
[src]
fn unregister(&mut self, poll: &mut Poll) -> Result<()>
[src]
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]
fn make(
self,
match_str: String
) -> Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>
[src]
self,
match_str: String
) -> Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>
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]
fn make(
self,
match_str: String
) -> Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>
[src]
self,
match_str: String
) -> Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>
impl<Data> MatchingReceiver for DBusSource<Data>
[src]
type F = Box<dyn FnMut(Message, &DBusSource<Data>, &mut Data) -> bool + Send + 'static>
Type of callback
fn start_receive(
&self,
match_rule: MatchRule<'static>,
callback: Self::F
) -> Token
[src]
&self,
match_rule: MatchRule<'static>,
callback: Self::F
) -> Token
fn stop_receive(&self, id: Token) -> Option<(MatchRule<'static>, Self::F)>
[src]
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,