pub struct Object(/* private fields */);
👎Deprecated since 0.1.4: rpsl-parser was renamed to rpsl-rs, please use that crate instead.
Expand description
Represents a RPSL object.
§Examples
Create a new role object
let role_acme = rpsl::Object::new(vec![
rpsl::Attribute::new("role".to_string(), vec![Some("ACME Company".to_string())]),
rpsl::Attribute::new(
"address".to_string(),
vec![Some("Packet Street 6".to_string())],
),
rpsl::Attribute::new(
"address".to_string(),
vec![Some("128 Series of Tubes".to_string())],
),
rpsl::Attribute::new("address".to_string(), vec![Some("Internet".to_string())]),
rpsl::Attribute::new(
"email".to_string(),
vec![Some("rpsl-parser@github.com".to_string())],
),
rpsl::Attribute::new("nic-hdl".to_string(), vec![Some("RPSL1-RIPE".to_string())]),
rpsl::Attribute::new("source".to_string(), vec![Some("RIPE".to_string())]),
]);
And then print the email
attribute by it’s index
println!("{:#?}", role_acme[4]);
Implementations§
Trait Implementations§
Source§impl IntoIterator for Object
impl IntoIterator for Object
impl Eq for Object
impl StructuralPartialEq for Object
Auto Trait Implementations§
impl Freeze for Object
impl RefUnwindSafe for Object
impl Send for Object
impl Sync for Object
impl Unpin for Object
impl UnwindSafe for Object
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