Skip to content
프로젝트

소개

XDG 포털의 D-Bus 인터페이스를 위한 Rust 래퍼입니다.

개발 도구

이 수치를 측정하는 방법

What you can do

  • tracing - Record various debug information using the tracing library - No
  • tokio - Enable tokio runtime on zbus dependency - Yes
  • async-io - Enable zbus's built-in runtime, compatible with runtimes such as smol or glib - No
  • frontend - Enables all frontend APIs, individual APIs can be enabled separately if needed with account , camera, screencast and so on - No

측정된 스타 증가

in 24h
0
in 7 days
+1
in 15 days
+1
in 1 month
기록 수집 중

서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.

README.md

Original

ASHPD

docs crates.io CI

ASHPD, acronym of Aperture Science Handheld Portal Device is a Rust & zbus wrapper of the XDG portals DBus interfaces. The library aims to provide an easy way to interact with the various portals defined per the specifications. It provides an alternative to the C library https://github.com/flatpak/libportal

Examples

Ask the compositor to pick a color

use ashpd::desktop::Color;

async fn run() -> ashpd::Result<()> {
    let color = Color::pick().send().await?.response()?;
    println!("({}, {}, {})", color.red(), color.green(), color.blue());
    Ok(())
}

Start a PipeWire stream from the user's camera

use ashpd::desktop::camera::Camera;

pub async fn run() -> ashpd::Result<()> {
    let camera = Camera::new().await?;
    if camera.is_present().await? {
        camera.request_access(Default::default()).await?;
        let remote_fd = camera.open_pipe_wire_remote(Default::default()).await?;
        // pass the remote fd to GStreamer for example
    }
    Ok(())
}

Optional features

Feature Description Default
tracing Record various debug information using the tracing library No
tokio Enable tokio runtime on zbus dependency Yes
async-io Enable zbus's built-in runtime, compatible with runtimes such as smol or glib No
frontend Enables all frontend APIs, individual APIs can be enabled separately if needed with account , camera, screencast and so on No
glib Make all the enums derive glib::Enum. Flags are not supported yet No
gtk4 Implement From<Color> for gdk4::RGBA Provides WindowIdentifier::from_native that takes a IsA<gtk4::Native> No
gtk4_wayland Provides WindowIdentifier::from_native that takes a IsA<gtk4::Native> with Wayland backend support only No
gtk4_x11 Provides WindowIdentifier::from_native that takes a IsA<gtk4::Native> with X11 backend support only No
pipewire Provides ashpd::desktop::camera::pipewire_streams that helps you retrieve the various camera streams associated with the retrieved file descriptor No
raw_handle Provides WindowIdentifier::from_raw_handle and WindowIdentifier::as_raw_handle for raw-window-handle crate No
wayland Provides WindowIdentifier::from_wayland for wayland-client crate No
backend Enables portal backend implementation support No

Demo

The library comes with a demo built using the GTK 4 Rust bindings and previews most of the portals. It is meant as a test case for the portals (from a distributor perspective) and as a way for the developers to see which portals exists and how to integrate them into their application using ASHPD.

Translations

Helping to translate ASHPD Demo or add support to a new language is very welcome. You can find everything you need at: l10n.gnome.org/module/ashpd/

Backend demo

The library also comes with a backend demo that exemplifies how to implement a portal backend.

관련 프로젝트 살펴보기

불러오는 중…