1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
=head1 NAME
libnbd-rust - how to use libnbd from Rust
=head1 SYNOPSIS
let nbd = libnbd::Handle::new().unwrap();
nbd.connect_uri("nbd://localhost").unwrap();
let size = nbd.get_size().unwrap();
println!("{size} bytes");
In C<Cargo.toml> add:
[dependencies]
libnbd = VERSION | { path = "libnbd/rust" }
=head1 DESCRIPTION
This manual page documents how to use libnbd to access Network Block
Device (NBD) servers from the Rust programming language.
The Rust bindings work very similarly to the C bindings so you should
start by reading L<libnbd(3)>.
There is also a higher level asynchronous API using Tokio.
If you build libnbd from source, the main documentation can be found
in F<libnbd/rust/target/doc/libnbd/index.html>
For the ordinary interface, start by reading the documentation for
C<Handle>. For the higher level asynchronous API, start by reading
C<AsyncHandle>.
C<libnbd-sys> is a very low level wrapper around the libnbd API which
should not be used directly.
=head1 EXAMPLES
This directory contains examples written in Rust:
L<https://gitlab.com/nbdkit/libnbd/tree/master/rust/examples>
=head1 SEE ALSO
L<libnbd(3)>.
=head1 AUTHORS
Tage Johansson
=head1 COPYRIGHT
Copyright Tage Johansson
|