pub trait VrpTarget {
type Update: VrpUpdate;
fn start(&mut self, reset: bool) -> Self::Update;
fn apply(
&mut self,
update: Self::Update,
reset: bool,
timing: Timing
) -> Result<(), VrpError>;
}
Expand description
A type that keeps data received via RTR.
The data of the target consisting of a set of items called VRPs for Validated RPKI Payload. It is modified by atomic updates that add or remove items of the set.
This trait provides a method to start and apply updates which are
collected into a different type that implements the companion
VrpUpdate
trait.
Required Associated Types
Required Methods
Starts a new update.
If the update is a for a reset query, reset
will be true
, meaning
that when the update is applied, all previous data should be removed.
This flag is repeated later in apply
, leaving it to implementations
whether to store updates differently for reset and serial queries.
Applies an update to the target.
The data to apply is handed over via update
. If reset
is true
,
the data should replace the current data of the target. Otherwise it
entries should be added and removed according to the action. The
timing
parameter contains the timing information provided by the
server.