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
impl BandwidthGroup
Sourcepub fn get_name(&self) -> Result<&'static str, VboxError>
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();Sourcepub fn get_type(&self) -> Result<BandwidthGroupType, VboxError>
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();Sourcepub fn get_reference(&self) -> Result<u32, VboxError>
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();Sourcepub fn get_max_bytes_per_sec(&self) -> Result<i64, VboxError>
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();Sourcepub fn set_max_bytes_per_sec(
&self,
max_bytes_per_sec: i64,
) -> Result<(), VboxError>
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
impl Debug for BandwidthGroup
Source§impl Display for BandwidthGroup
impl Display for BandwidthGroup
Auto Trait Implementations§
impl Freeze for BandwidthGroup
impl RefUnwindSafe for BandwidthGroup
impl !Send for BandwidthGroup
impl !Sync for BandwidthGroup
impl Unpin for BandwidthGroup
impl UnsafeUnpin for BandwidthGroup
impl UnwindSafe for BandwidthGroup
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more