pub fn release_name(&self, name: &str) -> Result<ReleaseNameReply> {
        // TODO: Use an actual struct with an API for this.
        let msg = Message::new_method_call("org.freedesktop.DBus",
                                           "/org/freedesktop/DBus",
                                           "org.freedesktop.DBus",
                                           "ReleaseName")
            .add_argument(&name);
        if let Some(mut results) = self.conn.call_sync(msg.message)? {
            if let Some(Value::BasicValue(BasicValue::Uint32(r))) = results.pop() {
                match r {
                    1 => Ok(ReleaseNameReply::Released),
                    2 => Ok(ReleaseNameReply::NonExistent),
                    3 => Ok(ReleaseNameReply::NotOwner),
                    _ => bail!(ErrorKind::InvalidReply(format!("ReleaseName: invalid response {}", r))),
                }
            } else {
                bail!(ErrorKind::InvalidReply("ReleaseName: invalid response".to_string()));
            }
        } else {
            bail!(ErrorKind::InvalidReply("ReleaseName: no response".to_string()));
        }
    }
/// Release a name on the bus.
Release a name on the bus.
Release a name on the bus .
pub fn release_name(&self, name: &str) -> Result<ReleaseNameReply> {
        // TODO: Use an actual struct with an API for this.
        let msg = Message::new_method_call("org.freedesktop.DBus",
                                           "/org/freedesktop/DBus",
                                           "org.freedesktop.DBus",
                                           "ReleaseName")
            .add_argument(&name);
        if let Some(mut results) = self.conn.call_sync(msg.message)? {
            if let Some(Value::BasicValue(BasicValue::Uint32(r))) = results.pop() {
                match r {
                    1 => Ok(ReleaseNameReply::Released),
                    2 => Ok(ReleaseNameReply::NonExistent),
                    3 => Ok(ReleaseNameReply::NotOwner),
                    _ => bail!(ErrorKind::InvalidReply(format!("ReleaseName: invalid response {}", r))),
                }
            } else {
                bail!(ErrorKind::InvalidReply("ReleaseName: invalid response".to_string()));
            }
        } else {
            bail!(ErrorKind::InvalidReply("ReleaseName: no response".to_string()));
        }
    }
pub fn release_name ( & self , name : & str ) -> Result < ReleaseNameReply > { // TODO: Use an actual struct with an API for this. let msg = Message :: new_method_call ( " " , " " , " " , " " ) . add_argument ( & name ) ; if let Some ( mut results ) = self . conn . call_sync ( msg . message ) ? { if let Some ( Value :: BasicValue ( BasicValue :: Uint32 ( r ) ) ) = results . pop ( ) { match r { 1 => Ok ( ReleaseNameReply :: Released ) , 2 => Ok ( ReleaseNameReply :: NonExistent ) , 3 => Ok ( ReleaseNameReply :: NotOwner ) , _ => bail ! ( ErrorKind InvalidReply ( format ( " " r ) ) ) , } } else { bail ! ( ErrorKind InvalidReply ( " " to_string ( ) ) ) ; } } else { bail ! ( ErrorKind InvalidReply ( " " to_string ( ) ) ) ; } }
Release a name on the bus.
Release a name on the bus .
&self
name
&str