Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/dbus/src/crossroads/   (Firefox Browser Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 1 kB image not shown  

Quelle  stdimpl.rs

  Sprache: Rust
 

use super::crossroads::Crossroads;
use super::handlers::{ParInfo, Par};
use super::info::{IfaceInfo, MethodInfo, PropInfo};
use crate::arg;
use super::MethodErr;

pub struct DBusProperties;

impl DBusProperties {
    pub fn register(cr: &mut Crossroads<Par>) {
        cr.register_custom::<Self>(IfaceInfo::new("org.freedesktop.DBus.Properties",
            vec!(MethodInfo::new_par("Get", |_: &DBusProperties, info| {
                let (iname, propname) = info.msg().read2()?; 
                let (lookup, pinfo) = info.crossroads().reg_prop_lookup(info.path_data(), iname, propname)
                    .ok_or_else(|| { MethodErr::no_property(&"Could not find property") })?;
                let handler = &pinfo.handlers.0.as_ref()
                    .ok_or_else(|| { MethodErr::no_property(&"Property can not be read") })?;
                let iface = &**lookup.iface;
                let mut pinfo = ParInfo::new(info.msg(), lookup);
                let mut mret = info.msg().method_return();
                {
                    let mut ia = arg::IterAppend::new(&mut mret);
                    (handler)(iface, &mut ia, &mut pinfo)?;
                }
                Ok(Some(mret))
            })),
            vec!(), vec!()
        ));

    }
}

pub struct DBusIntrospectable;

use crate::crossroads as cr;

pub trait Introspectable {
    fn introspect(&self, info: &cr::ParInfo) -> Result<String, cr::MethodErr>;
}

pub fn introspectable_ifaceinfo<I>() -> cr::IfaceInfo<'static, cr::Par>
where I: Introspectable + Send + Sync + 'static {
    cr::IfaceInfo::new("org.freedesktop.DBus.Introspectable", vec!(
        MethodInfo::new_par("Introspect", |intf: &I, info| {
            let xml_data = intf.introspect(info)?;
            let rm = info.msg().method_return();
            let rm = rm.append1(xml_data);
            Ok(Some(rm))
       }),
    ), vec!(), vec!())
}



Messung V0.5 in Prozent
C=96 H=96 G=95

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-06-28) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.