pub struct Tai { /* private fields */ }Expand description
A Tracking Area Identity: network plus TrackingAreaCode.
Implementations§
Source§impl Tai
impl Tai
Sourcepub const fn new(plmn: PlmnId, tac: TrackingAreaCode) -> Self
pub const fn new(plmn: PlmnId, tac: TrackingAreaCode) -> Self
A tracking area identity from its parts.
Sourcepub const fn tac(self) -> TrackingAreaCode
pub const fn tac(self) -> TrackingAreaCode
The tracking area.
Source§impl Tai
impl Tai
Sourcepub const EPS_OCTETS: usize = 5
pub const EPS_OCTETS: usize = 5
The wire length of an EPS Tracking Area Identity, in octets.
Sourcepub const FIVE_GS_OCTETS: usize = 6
pub const FIVE_GS_OCTETS: usize = 6
The wire length of a 5GS Tracking Area Identity, in octets.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
Decode a TAI, at either width.
Five octets is the EPS form (16-bit code, TS 29.274 §8.21.4) and six the
5GS one (24-bit code, TS 24.501). The width is taken from the field’s
length and kept, because an EPS code appears in 5GS zero-padded and
the two must not silently compare equal — see TrackingAreaCode.
§Errors
DecodeError for any other length, a malformed PLMN identity, or a
reserved tracking area code.
Sourcepub fn to_bytes(self, out: &mut [u8]) -> Result<usize, DecodeError>
pub fn to_bytes(self, out: &mut [u8]) -> Result<usize, DecodeError>
Encode to the wire, writing into out and returning the octet count.
Five octets for an EPS code and six for a 5GS one — the width the code was assigned at, never widened on the way out.
§Errors
DecodeError when out is too short.