pub struct SecureOn(/* private fields */);Expand description
A SecureON token.
A SecureON token consists of six bytes, similar to a MAC address.
If such a SecureON token is set in the firmware of the target device, the device will only wake up if the magic packet additionally includes the given SecureON token.
This offers a marginal amount of protection against unauthorized wake-ups in case the MAC address of the target device is known. Note however that this SecureON token is included in the magic packet as plain text, so it should not be assumed a secret.
Implementations§
Trait Implementations§
Source§impl FromStr for SecureOn
Parse a SecureON token from a string:
impl FromStr for SecureOn
Parse a SecureON token from a string:
assert_eq!(SecureOn::from_str("00-DE-AD-BE-EF-00"), Ok(SecureOn::new([0x00, 0xDE, 0xAD, 0xBE, 0xEF, 0x00])));
assert_eq!(SecureOn::from_str("00:DE:AD:BE:EF:00"), Ok(SecureOn::new([0x00, 0xDE, 0xAD, 0xBE, 0xEF, 0x00])));
assert_eq!(SecureOn::from_str("00:de:ad:be:ef:00"), Ok(SecureOn::new([0x00, 0xDE, 0xAD, 0xBE, 0xEF, 0x00])));
assert!(SecureOn::from_str("00-DE:AD:BE:EF-00").is_err());
assert!(SecureOn::from_str("DE-AD-BE-EF").is_err());impl Copy for SecureOn
impl Eq for SecureOn
impl StructuralPartialEq for SecureOn
Auto Trait Implementations§
impl Freeze for SecureOn
impl RefUnwindSafe for SecureOn
impl Send for SecureOn
impl Sync for SecureOn
impl Unpin for SecureOn
impl UnsafeUnpin for SecureOn
impl UnwindSafe for SecureOn
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