Struct j1939::Id

source ·
pub struct Id(/* private fields */);

Implementations§

source§

impl Id

Frame ID

source

pub const fn new(id: u32) -> Self

Construct new Frame ID from raw integer.

The ID is masked to 29 bits to ensure that the ID is within the valid range.

Examples found in repository?
examples/j1939decode.rs (line 28)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub const fn as_raw(&self) -> u32

Return ID as raw integer.

Examples found in repository?
examples/j1939decode.rs (line 31)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn priority(&self) -> u8

Frame priority

The priority ranges from 0 to 7, where 0 is the highest priority and 7 the lowest priority.

Default priority for informational, proprietary, request and acknowledgement frames is 6. Default priority for control frames (e.g., speeding up or slowing down the vehicle) is 3.

Examples found in repository?
examples/j1939decode.rs (line 35)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn data_page(&self) -> u8

Data page (DP)

Returns the data page bit of the frame ID.

Examples found in repository?
examples/j1939decode.rs (line 38)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn pgn(&self) -> PGN

Parameter Group Number (PGN)

Returns the parameter group number of the frame ID.

Examples found in repository?
examples/j1939decode.rs (line 39)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn pgn_raw(&self) -> u32

Parameter Group Number

Returns the raw parameter group number of the frame ID.

Examples found in repository?
examples/j1939decode.rs (line 40)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn pdu_format(&self) -> PDUFormat

PDU Format (PF)

Returns the PDU format of the frame ID.

Examples found in repository?
examples/j1939decode.rs (line 43)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn is_broadcast(&self) -> bool

Test if the frame is a broadcast frame

Returns true if the frame is a broadcast frame, false otherwise.

Examples found in repository?
examples/j1939decode.rs (line 44)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn destination_address(&self) -> Option<u8>

Frame Destination Address (DA)

Returns the destination address of the frame ID.

The destination address is only available on PDU1 frames.

Examples found in repository?
examples/j1939decode.rs (line 53)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn group_extension(&self) -> Option<u8>

Frame Group Extension (GE)

Returns the group extension of the frame ID.

The group extension is only available on PDU2 frames.

Examples found in repository?
examples/j1939decode.rs (line 46)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}
source

pub fn pdu_specific(&self) -> u8

PDU Specific (PS)

Returns the PDU specific value of the frame ID.

source

pub fn source_address(&self) -> u8

Device Source Address (SA)

Returns the source address of the frame ID.

Examples found in repository?
examples/j1939decode.rs (line 61)
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
fn main() {
    let input = env::args().nth(1);

    if input.is_none() {
        usage();
        return;
    }

    let id_str = input.unwrap();
    if !id_str.starts_with("0x") {
        usage();
        return;
    }

    let id_raw = u32::from_str_radix(id_str.trim_start_matches("0x"), 16).expect("Invalid ID");

    let id = Id::new(id_raw);

    println!("ID");
    println!(" Hex: 0x{:X?}", id.as_raw());
    println!(" Dec: {}", id.as_raw());
    println!(" Bin: {:029b}", id.as_raw());
    println!("Priority");
    println!(" Hex: 0x{:X?}", id.priority());
    println!(" Dec: {}", id.priority());
    println!(" Bin: {:03b}", id.priority());
    println!("Data Page (DP): {}", id.data_page());
    println!("Parameter Group Number (PGN): {:?}", id.pgn());
    println!(" Hex: 0x{:X?}", id.pgn_raw());
    println!(" Dec: {}", id.pgn_raw());
    println!(" Bin: {:024b}", id.pgn_raw());
    println!("PDU Format: {:?}", id.pdu_format());
    println!("Broadcast: {}", id.is_broadcast());

    if let Some(ge) = id.group_extension() {
        println!("Group Extension (GE)/PDU Specific (PS)");
        println!(" Hex: 0x{:X?}", ge);
        println!(" Dec: {}", ge);
        println!(" Bin: {:08b}", ge);
    }

    if let Some(da) = id.destination_address() {
        println!("Destination Address (DA)");
        println!(" Hex: 0x{:X?}", da);
        println!(" Dec: {}", da);
        println!(" Bin: {:08b}", da);
    }

    println!("Source Address (SA)");
    println!(" Hex: 0x{:X?}", id.source_address());
    println!(" Dec: {}", id.source_address());
    println!(" Bin: {:08b}", id.source_address());
}

Trait Implementations§

source§

impl Clone for Id

source§

fn clone(&self) -> Id

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Id

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for Id

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for Id

source§

fn eq(&self, other: &Id) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for Id

source§

impl Eq for Id

source§

impl StructuralPartialEq for Id

Auto Trait Implementations§

§

impl Freeze for Id

§

impl RefUnwindSafe for Id

§

impl Send for Id

§

impl Sync for Id

§

impl Unpin for Id

§

impl UnwindSafe for Id

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.