• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

varlink / rust
56%

Build:
DEFAULT BRANCH: master
Repo Added 19 Mar 2018 03:36PM UTC
Files 27
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

LAST BUILD ON BRANCH master
branch: SELECT
CHANGE BRANCH
x
  • No branch selected
  • RaitoBezarius/master
  • asn-generator
  • clap_update
  • clippy
  • dependabot/cargo/bitflags-2.0.0
  • dependabot/cargo/bitflags-2.0.2
  • dependabot/cargo/bitflags-2.1.0
  • dependabot/cargo/bitflags-2.2.1
  • dependabot/cargo/bitflags-2.3.1
  • dependabot/cargo/bitflags-2.3.3
  • dependabot/cargo/bitflags-2.4.0
  • dependabot/cargo/bitflags-2.4.1
  • dependabot/cargo/bitflags-2.6.0
  • dependabot/cargo/clap_complete-4.5.60
  • dependabot/cargo/colored-3.0.0
  • dependabot/cargo/proc-macro2-1.0.103
  • dependabot/cargo/quote-1.0.42
  • dependabot/cargo/syn-2.0.10
  • dependabot/cargo/syn-2.0.108
  • dependabot/cargo/syn-2.0.110
  • dependabot/cargo/syn-2.0.13
  • dependabot/cargo/syn-2.0.15
  • dependabot/cargo/syn-2.0.16
  • dependabot/cargo/syn-2.0.27
  • dependabot/cargo/syn-2.0.28
  • dependabot/cargo/syn-2.0.29
  • dependabot/cargo/syn-2.0.3
  • dependabot/cargo/syn-2.0.31
  • dependabot/cargo/syn-2.0.32
  • dependabot/cargo/syn-2.0.37
  • dependabot/cargo/syn-2.0.38
  • dependabot/cargo/thiserror-2.0.18
  • dependabot/cargo/uds_windows-1.0.1
  • feat/generator-safe-idents
  • feat/methodcall-push-fd
  • feature/hh/async_more
  • feature/hh/async_with
  • feature/hh/features
  • feature/hh/tempdir
  • feature/introspection
  • master
  • peg
  • refs/heads/dependabot/cargo/syn-2.0.18
  • refs/tags/varlink-cli-4.5.3
  • refs/tags/varlink_generator-10.1.0
  • refs/tags/varlink_parser-4.2.0
  • remove-unix_socket-dep
  • rust-version
  • style
  • syn-2-upgrade
  • unignore-tests
  • v13

25 Jul 2026 04:39PM UTC coverage: 56.305% (+1.7%) from 54.632%
30166081117

push

github

web-flow
feat: add MethodCall::push_fd() for passing file descriptors (SCM_RIGHTS) (#149)

systemd's `sd-varlink` extends varlink with file-descriptor passing over
the
Unix socket via SCM_RIGHTS: fds are pushed before the call and
referenced from
the parameters by their push-order index. (This is not part of the core
varlink
protocol as specified on varlink.org — the push-order convention is the
de-facto
one used by systemd's services.) This crate had no client-side way to
attach
fds; this adds that, mirroring `sd_varlink_push_fd()`.

## API

```rust
let mut call = client.some_method(args);
let idx = call.push_fd(fd)?;   // -> 0, then 1, ... (push order == the index methods reference)
call.more()?;                  // or .call()/.oneway(); fds are delivered with the request
```

- `MethodCall::push_fd(fd) -> io::Result<usize>` (unix only). Dups the
fd with
`F_DUPFD_CLOEXEC` (caller keeps ownership of the original), queues it,
and
  returns its push-order index.
- On send, queued fds are delivered with the request via a single
`sendmsg()` + `SCM_RIGHTS` on the connection's socket; any bytes past
the first
  `sendmsg` are written normally through the existing writer.
- Only `AF_UNIX`-socket-backed connections support this — SCM_RIGHTS
does not
exist elsewhere. `push_fd` checks the socket family up front
(`getsockname`),
so a `tcp:` connection or a reader/writer-pair connection fails
immediately
  with `io::ErrorKind::Unsupported` rather than later at send time.

No opt-in gate (cf. systemd's
`SD_VARLINK_SERVER_ALLOW_FD_PASSING_OUTPUT`):
on the client side, calling `push_fd` is itself the explicit opt-in — no
ancillary data is ever attached unless the application pushed an fd for
that
specific call.

## Scope

Send-only. Receiving descriptors (server → client) is not implemented —
it would
require recvmsg-based reading throughout the input path, and nothing
needs it yet.
`cfg(unix)` only, matching the crate's existing platform split; `libc`
is already
a unix depe... (continued)

222 of 226 new or added lines in 2 files covered. (98.23%)

64 existing lines in 2 files now uncovered.

3045 of 5408 relevant lines covered (56.31%)

13.6 hits per line

Relevant lines Covered
Build:
Build:
5408 RELEVANT LINES 3045 COVERED LINES
13.6 HITS PER LINE
Source Files on master
  • Tree
  • List 27
  • Changed 3
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line

Recent builds

Builds Branch Commit Type Ran Committer Via Coverage
30166081117 master feat: add MethodCall::push_fd() for passing file descriptors (SCM_RIGHTS) (#149) systemd's `sd-varlink` extends varlink with file-descriptor passing over the Unix socket via SCM_RIGHTS: fds are pushed before the call and referenced from the param... push 25 Jul 2026 04:42PM UTC web-flow github
56.31
30101427362 feat/generator-safe-idents Merge 52d48254b into 4f73812d6 Pull #152 24 Jul 2026 02:34PM UTC web-flow github
54.67
30100250885 feat/methodcall-push-fd Merge 0aa089bbb into 4f73812d6 Pull #149 24 Jul 2026 02:17PM UTC web-flow github
56.31
30052262086 clippy chore: cargo clippy and fmt and nix flake update Pull #151 23 Jul 2026 11:11PM UTC haraldh github
54.62
30052264835 clippy Merge d2adf94cb into b733583c9 Pull #151 23 Jul 2026 11:10PM UTC web-flow github
54.62
30052209412 clippy chore: cargo clippy push 23 Jul 2026 11:09PM UTC haraldh github
54.63
30052211486 clippy Merge cc3120530 into b733583c9 Pull #151 23 Jul 2026 11:09PM UTC web-flow github
54.63
30051894608 clippy chore: cargo clippy Pull #151 23 Jul 2026 11:04PM UTC haraldh github
54.63
30051844958 master feat: Expose some functions for async users who accepts the connection themselves (#147) Fixes #146. The rationale is described in commit messages but it boils down to: it's very hard to accept connections yourselves and reuse these logic. push 23 Jul 2026 11:03PM UTC web-flow github
54.63
30051742848 RaitoBezarius/master chore: cargo clippy push 23 Jul 2026 11:01PM UTC haraldh github
54.63
See All Builds (343)
  • Repo on GitHub
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc