You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While trying to write tests best path selection in rotonda-store - which requires From<Vec<u8>> and Into<Vec<u8>> for types to be stored - I need a way to create OwnedPathAttributes from scratch (so not from an existing PDUs). One way could be to create an empty PaMap and try to convert that into a PathAttributes.
Having an From<..> impl for this, would allow OrdRoute to take &OwnedPathAttributes as argument, instead of &PaMap. This would be handy, since Rotonda itself stores OwnedPathAttributes as its meta type in the store.
The text was updated successfully, but these errors were encountered:
This raises some nice points for the ongoing refactor of the path attributes, which we'll need to discuss a bit more, but for now maybe this can get things going:
let mut pamap = PaMap::empty();
pamap.set(crate::bgp::types::Origin(OriginType::Igp));
let mut buf = Vec::new();
for pa in pamap.attributes.values() {
pa.compose(&mut buf).unwrap();
}
let owned = OwnedPathAttributes::from((PduParseInfo::modern(), buf));
While trying to write tests best path selection in
rotonda-store
- which requiresFrom<Vec<u8>>
andInto<Vec<u8>>
for types to be stored - I need a way to createOwnedPathAttributes
from scratch (so not from an existing PDUs). One way could be to create an emptyPaMap
and try to convert that into aPathAttributes
.I though a (convoluted) way could be:
This is incorrect, however.
Having an
From<..> impl
for this, would allowOrdRoute
to take&OwnedPathAttributes
as argument, instead of&PaMap
. This would be handy, since Rotonda itself storesOwnedPathAttributes
as its meta type in the store.The text was updated successfully, but these errors were encountered: