pub struct SwitchInfo {
pub hostname: String,
pub uptime: String,
pub mac_address: String,
pub cpu_load: [u8; 3],
pub ps_status: [u8; 2],
}
Fields§
§hostname: String
§uptime: String
§mac_address: String
§cpu_load: [u8; 3]
§ps_status: [u8; 2]
Implementations§
Source§impl SwitchInfo
impl SwitchInfo
pub fn new(ip_addr: &str) -> Self
pub fn read_info(ip_addr: &str) -> Result<SwitchInfo, SwitchError>
pub fn read_hostname(session: &mut SyncSession) -> Result<String, SwitchError>
pub fn read_uptime(session: &mut SyncSession) -> Result<String, SwitchError>
pub fn read_mac_address( session: &mut SyncSession, ) -> Result<String, SwitchError>
pub fn read_cpu_load(session: &mut SyncSession) -> Result<[u8; 3], SwitchError>
pub fn read_ps_status(session: &mut SyncSession) -> Result<[u8; 2], SwitchError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SwitchInfo
impl RefUnwindSafe for SwitchInfo
impl Send for SwitchInfo
impl Sync for SwitchInfo
impl Unpin for SwitchInfo
impl UnwindSafe for SwitchInfo
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more