pub struct AsPathAttribute {
pub segments: Vec<AsPathSegment>,
}Expand description
ASPathAttribute is a well-known mandatory attribute that contains a list of TLV encoded path segments. Type is either 1 for AS_SET or 2 for AS_SEQUENCE, length is a 1 octet field containing the number of ASNS and the value contains the ASNs. This is defined in Section 4.3 of RFC4271.
Fields§
§segments: Vec<AsPathSegment>Implementations§
Source§impl AsPathAttribute
impl AsPathAttribute
pub fn from_asns(asns: Vec<u32>) -> PathAttribute
pub fn from_wire<'a>( ctx: &ParserContext, buf: &'a [u8], ) -> IResult<&'a [u8], Self, BgpParserError<&'a [u8]>>
pub fn to_wire(&self, ctx: &ParserContext, out: &mut BytesMut) -> Result<()>
pub fn wire_len(&self, ctx: &ParserContext) -> Result<u16>
Trait Implementations§
Source§impl Clone for AsPathAttribute
impl Clone for AsPathAttribute
Source§fn clone(&self) -> AsPathAttribute
fn clone(&self) -> AsPathAttribute
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AsPathAttribute
impl Debug for AsPathAttribute
Source§impl<'de> Deserialize<'de> for AsPathAttribute
impl<'de> Deserialize<'de> for AsPathAttribute
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for AsPathAttribute
Source§impl PartialEq for AsPathAttribute
impl PartialEq for AsPathAttribute
Source§fn eq(&self, other: &AsPathAttribute) -> bool
fn eq(&self, other: &AsPathAttribute) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for AsPathAttribute
impl Serialize for AsPathAttribute
impl StructuralPartialEq for AsPathAttribute
Auto Trait Implementations§
impl Freeze for AsPathAttribute
impl RefUnwindSafe for AsPathAttribute
impl Send for AsPathAttribute
impl Sync for AsPathAttribute
impl Unpin for AsPathAttribute
impl UnsafeUnpin for AsPathAttribute
impl UnwindSafe for AsPathAttribute
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