Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 12 additions & 10 deletions plugins/rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
//!
//! NBDKit is a toolkit for building Network Block Device servers.
//!
//! [https://github.com/libguestfs/nbdkit](https://github.com/libguestfs/nbdkit)
//! <https://github.com/libguestfs/nbdkit>
//!
//! To use nbdkit, build your project as a cdylib. Define your plugin by
//! implementing [`Server`], and then register it with [`plugin!`]. See
Expand Down Expand Up @@ -217,9 +217,9 @@ pub enum CacheFlags {
Native = 2,
}

impl Into<i32> for CacheFlags {
fn into(self) -> i32 {
self as i32
impl From<CacheFlags> for i32 {
fn from(cf: CacheFlags) -> Self {
cf as Self
}
}

Expand All @@ -238,9 +238,9 @@ pub enum FuaFlags {
Native = 2,
}

impl Into<i32> for FuaFlags {
fn into(self) -> i32 {
self as i32
impl From<FuaFlags> for i32 {
fn from(cf: FuaFlags) -> Self {
cf as Self
}
}

Expand Down Expand Up @@ -812,9 +812,11 @@ pub trait Server {
/// For security reasons (to avoid denial of service attacks) this callback
/// should be written to be as fast and take as few resources as possible.
/// If you use this callback, only use it to do basic access control, such
/// as checking [`peername`] against a whitelist. It may be better to do
/// access control outside the server, for example using TCP wrappers or a
/// firewall.
/// as checking
#[cfg_attr(feature = "nix", doc = "[`peername`]")]
#[cfg_attr(not(feature = "nix"), doc = "the peer name")]
/// against a whitelist. It may be better to do access control outside the
/// server, for example using TCP wrappers or a firewall.
///
/// The `readonly` flag informs the plugin that the server was started with
/// the `-r` flag on the command line.
Expand Down