use crate::enums::BandwidthGroupType;
use crate::utility::macros::macros::{
get_function_result_number, get_function_result_str, get_function_result_unit,
};
use crate::{BandwidthGroup, VboxError};
impl BandwidthGroup {
pub fn get_name(&self) -> Result<&'static str, VboxError> {
get_function_result_str!(self.object, GetName)
}
pub fn get_type(&self) -> Result<BandwidthGroupType, VboxError> {
let group_type = get_function_result_number!(self.object, GetType, u32)?;
Ok(BandwidthGroupType::from(group_type))
}
pub fn get_reference(&self) -> Result<u32, VboxError> {
get_function_result_number!(self.object, GetReference, u32)
}
pub fn get_max_bytes_per_sec(&self) -> Result<i64, VboxError> {
get_function_result_number!(self.object, GetMaxBytesPerSec, i64)
}
pub fn set_max_bytes_per_sec(&self, max_bytes_per_sec: i64) -> Result<(), VboxError> {
get_function_result_unit!(self.object, SetMaxBytesPerSec, max_bytes_per_sec)
}
}