Skip to main content

BandwidthGroup

Struct BandwidthGroup 

Source
pub struct BandwidthGroup { /* private fields */ }
Expand description

Represents one bandwidth group.

Reference to the official documentation:

https://www.virtualbox.org/sdkref/interface_i_bandwidth_group.html

Implementations§

Source§

impl BandwidthGroup

Source

pub fn get_name(&self) -> Result<&'static str, VboxError>

Name of the group.

§Returns

Returns &str on success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let bandwidth_control = machine.get_bandwidth_control().unwrap();
let bandwidth_group = bandwidth_control.get_bandwidth_group("g1").unwrap();
let name = bandwidth_group.get_name().unwrap();
Source

pub fn get_type(&self) -> Result<BandwidthGroupType, VboxError>

Type of the group.

§Returns

Returns &str on success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let bandwidth_control = machine.get_bandwidth_control().unwrap();
let bandwidth_group = bandwidth_control.get_bandwidth_group("g1").unwrap();
let group_type = bandwidth_group.get_type().unwrap();
Source

pub fn get_reference(&self) -> Result<u32, VboxError>

How many devices/medium attachments use this group.

§Returns

Returns u32 on success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let bandwidth_control = machine.get_bandwidth_control().unwrap();
let bandwidth_group = bandwidth_control.get_bandwidth_group("g1").unwrap();
let reference = bandwidth_group.get_reference().unwrap();
Source

pub fn get_max_bytes_per_sec(&self) -> Result<i64, VboxError>

The maximum number of bytes which can be transfered by all entities attached to this group during one second.

§Returns

Returns u32 on success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let bandwidth_control = machine.get_bandwidth_control().unwrap();
let bandwidth_group = bandwidth_control.get_bandwidth_group("g1").unwrap();
let max_bytes_per_sec = bandwidth_group.get_max_bytes_per_sec().unwrap();
Source

pub fn set_max_bytes_per_sec( &self, max_bytes_per_sec: i64, ) -> Result<(), VboxError>

The maximum number of bytes which can be transfered by all entities attached to this group during one second.

§Arguments
  • max_bytes_per_sec - u32.
§Returns

Returns () on success, or a VboxError on failure.

§Example

use virtualbox_rs::{VirtualBox};

let vbox = VirtualBox::init().unwrap();
let machine = vbox.
        find_machines("Freebsd_14").unwrap();
let bandwidth_control = machine.get_bandwidth_control().unwrap();
let bandwidth_group = bandwidth_control.get_bandwidth_group("g1").unwrap();
bandwidth_group.set_max_bytes_per_sec(100000).unwrap();

Trait Implementations§

Source§

impl Debug for BandwidthGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for BandwidthGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for BandwidthGroup

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.