redundant extern crate (rust 2018)
This commit is contained in:
parent
8cd9eded12
commit
33c29fbe56
|
@ -11,8 +11,6 @@ Library for managing Wake-on-LAN packets. It supports:
|
||||||
|
|
||||||
From string representation of MAC address and using defaults when broadcasting:
|
From string representation of MAC address and using defaults when broadcasting:
|
||||||
```rust
|
```rust
|
||||||
extern crate wakey;
|
|
||||||
|
|
||||||
let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':');
|
let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':');
|
||||||
match wol.send_magic() {
|
match wol.send_magic() {
|
||||||
Ok(_) => println!("Sent the magic packet!"),
|
Ok(_) => println!("Sent the magic packet!"),
|
||||||
|
@ -22,7 +20,6 @@ match wol.send_magic() {
|
||||||
|
|
||||||
Packets can also be constructed with raw bytes and sent from / to custom addresses:
|
Packets can also be constructed with raw bytes and sent from / to custom addresses:
|
||||||
```rust
|
```rust
|
||||||
extern crate wakey;
|
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
|
|
||||||
let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
//! Library for managing Wake-on-LAN packets.
|
//! Library for managing Wake-on-LAN packets.
|
||||||
//! # Example
|
//! # Example
|
||||||
//! ```
|
//! ```
|
||||||
//! extern crate wakey;
|
|
||||||
//! let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':');
|
//! let wol = wakey::WolPacket::from_string("01:02:03:04:05:06", ':');
|
||||||
//! match wol.send_magic() {
|
//! match wol.send_magic() {
|
||||||
//! Ok(_) => println!("Sent the magic packet!"),
|
//! Ok(_) => println!("Sent the magic packet!"),
|
||||||
|
@ -26,7 +25,6 @@ impl WolPacket {
|
||||||
/// Creates WOL packet from byte MAC representation
|
/// Creates WOL packet from byte MAC representation
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate wakey;
|
|
||||||
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn from_bytes(mac: &[u8]) -> WolPacket {
|
pub fn from_bytes(mac: &[u8]) -> WolPacket {
|
||||||
|
@ -36,7 +34,6 @@ impl WolPacket {
|
||||||
/// Creates WOL packet from string MAC representation (e.x. 00:01:02:03:04:05)
|
/// Creates WOL packet from string MAC representation (e.x. 00:01:02:03:04:05)
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate wakey;
|
|
||||||
/// let wol = wakey::WolPacket::from_string("00:01:02:03:04:05", ':');
|
/// let wol = wakey::WolPacket::from_string("00:01:02:03:04:05", ':');
|
||||||
/// ```
|
/// ```
|
||||||
/// # Panic
|
/// # Panic
|
||||||
|
@ -50,7 +47,6 @@ impl WolPacket {
|
||||||
/// Destination 255.255.255.255:9
|
/// Destination 255.255.255.255:9
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate wakey;
|
|
||||||
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||||
/// wol.send_magic();
|
/// wol.send_magic();
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -64,7 +60,6 @@ impl WolPacket {
|
||||||
/// Broadcasts the magic packet from / to specified address.
|
/// Broadcasts the magic packet from / to specified address.
|
||||||
/// # Example
|
/// # Example
|
||||||
/// ```
|
/// ```
|
||||||
/// extern crate wakey;
|
|
||||||
/// use std::net::SocketAddr;
|
/// use std::net::SocketAddr;
|
||||||
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
/// let wol = wakey::WolPacket::from_bytes(&vec![0x00, 0x01, 0x02, 0x03, 0x04, 0x05]);
|
||||||
/// let src = SocketAddr::from(([0,0,0,0], 0));
|
/// let src = SocketAddr::from(([0,0,0,0], 0));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user