pub struct Peer { /* private fields */ }Expand description
Represents a peer with the name, path and connection for the P2P peer.
Implementations§
Source§impl Peer
impl Peer
Sourcepub fn unique_name(&self) -> &OwnedUniqueName
pub fn unique_name(&self) -> &OwnedUniqueName
Returns the bus name of the peer.
Sourcepub fn well_known_name(&self) -> Option<&OwnedWellKnownName>
pub fn well_known_name(&self) -> Option<&OwnedWellKnownName>
Returns the well-known bus name of the peer, if it has one.
Sourcepub fn socket_address(&self) -> &Address
pub fn socket_address(&self) -> &Address
Returns the socket Address of the peer.
Sourcepub fn connection(&self) -> &Connection
pub fn connection(&self) -> &Connection
Returns the p2p Connection of the peer.
Sourcepub async fn try_from_bus_name(
bus_name: BusName<'_>,
conn: &Connection,
) -> AtspiResult<Self>
pub async fn try_from_bus_name( bus_name: BusName<'_>, conn: &Connection, ) -> AtspiResult<Self>
Try to create a new Peer from a bus name.
§Errors
Returns an error if the application proxy cannot be created or if it does not support get_application_bus_address.
A non-existent bus name will also return an error.
Sourcepub async fn proxies(&self, path: &ObjectPath<'_>) -> AtspiResult<Proxies<'_>>
pub async fn proxies(&self, path: &ObjectPath<'_>) -> AtspiResult<Proxies<'_>>
Sourcepub async fn as_root_accessible_proxy(&self) -> AtspiResult<AccessibleProxy<'_>>
pub async fn as_root_accessible_proxy(&self) -> AtspiResult<AccessibleProxy<'_>>
Returns an AccessibleProxy for the root accessible object of the peer.
§Errors
In case of an invalid connection.
Sourcepub async fn as_accessible_proxy(
&self,
obj: &ObjectRefOwned,
) -> AtspiResult<AccessibleProxy<'_>>
pub async fn as_accessible_proxy( &self, obj: &ObjectRefOwned, ) -> AtspiResult<AccessibleProxy<'_>>
Returns an AccessibleProxy for the accessible object of the peer.
§Errors
In case of an invalid connection or object path.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Peer
impl !RefUnwindSafe for Peer
impl Send for Peer
impl Sync for Peer
impl Unpin for Peer
impl !UnwindSafe for Peer
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
Mutably borrows from an owned value. Read more