pub struct SignalContext<'s> { /* private fields */ }
Expand description
A signal emission context.
For signal emission using the high-level API, you’ll need instances of this type.
See crate::InterfaceRef::signal_context
and crate::dbus_interface
documentation for details and examples of this type in use.
Implementations§
source§impl<'s> SignalContext<'s>
impl<'s> SignalContext<'s>
sourcepub fn new<P>(conn: &Connection, path: P) -> Result<Self>
pub fn new<P>(conn: &Connection, path: P) -> Result<Self>
Create a new signal context for the given connection and object path.
sourcepub fn from_parts(conn: Connection, path: ObjectPath<'s>) -> Self
pub fn from_parts(conn: Connection, path: ObjectPath<'s>) -> Self
Create a new signal context for the given connection and object path.
sourcepub fn set_destination(self, destination: BusName<'s>) -> Self
pub fn set_destination(self, destination: BusName<'s>) -> Self
Set the destination for the signal emission.
Signals are typically broadcasted and thus don’t have a destination. However, there are cases where you need to unicast signals to specific peers. This method allows you to set the destination for the signals emitted with this context.
sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Get a reference to the associated connection.
sourcepub fn path(&self) -> &ObjectPath<'s>
pub fn path(&self) -> &ObjectPath<'s>
Get a reference to the associated object path.
sourcepub fn destination(&self) -> Option<&BusName<'s>>
pub fn destination(&self) -> Option<&BusName<'s>>
Get a reference to the associated destination (if any).
sourcepub fn to_owned(&self) -> SignalContext<'static>
pub fn to_owned(&self) -> SignalContext<'static>
Creates an owned clone of self
.
sourcepub fn into_owned(self) -> SignalContext<'static>
pub fn into_owned(self) -> SignalContext<'static>
Creates an owned clone of self
.
Trait Implementations§
source§impl<'s> Clone for SignalContext<'s>
impl<'s> Clone for SignalContext<'s>
source§fn clone(&self) -> SignalContext<'s>
fn clone(&self) -> SignalContext<'s>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'s> Freeze for SignalContext<'s>
impl<'s> !RefUnwindSafe for SignalContext<'s>
impl<'s> Send for SignalContext<'s>
impl<'s> Sync for SignalContext<'s>
impl<'s> Unpin for SignalContext<'s>
impl<'s> !UnwindSafe for SignalContext<'s>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)