pub struct MigratorBuilder<P, T, FRO, FRN, FWO, FWN>where
P: Send + Sync,
T: Send + Sync,
FRO: Fn(&P) -> BoxFuture<'_, Result<T, String>> + Sync + Send,
FRN: Fn(&P) -> BoxFuture<'_, Result<T, String>> + Sync + Send,
FWO: Fn(&P) -> BoxFuture<'_, Result<T, String>> + Sync + Send,
FWN: Fn(&P) -> BoxFuture<'_, Result<T, String>> + Sync + Send,{ /* private fields */ }
Expand description
The migration builder is used to configure and construct an instance of a Migrator. This migrator can be used to perform LaunchDarkly assisted technology migrations through the use of migration-based feature flags.
Implementations§
Source§impl<P, T, FRO, FRN, FWO, FWN> MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
Sourcepub fn new(client: Arc<Client>) -> Self
pub fn new(client: Arc<Client>) -> Self
Create a new migrator builder instance with the provided client.
Sourcepub fn read_execution_order(self, order: ExecutionOrder) -> Self
pub fn read_execution_order(self, order: ExecutionOrder) -> Self
The read execution order influences the concurrency and execution order for read operations involving multiple origins.
Sourcepub fn track_latency(self, measure: bool) -> Self
pub fn track_latency(self, measure: bool) -> Self
Enable or disable latency tracking for migration operations. This latency information can be sent upstream to LaunchDarkly to enhance migration visibility.
Sourcepub fn track_errors(self, measure: bool) -> Self
pub fn track_errors(self, measure: bool) -> Self
Enable or disable error tracking for migration operations. This error information can be sent upstream to LaunchDarkly to enhance migration visibility.
Sourcepub fn read(
self,
old: FRO,
new: FRN,
compare: Option<fn(&T, &T) -> bool>,
) -> Self
pub fn read( self, old: FRO, new: FRN, compare: Option<fn(&T, &T) -> bool>, ) -> Self
Read can be used to configure the migration-read behavior of the resulting Migrator instance.
Users are required to provide two different read methods – one to read from the old migration origin, and one to read from the new origin. Additionally, users can opt-in to consistency tracking by providing a comparison function.
Depending on the migration stage, one or both of these read methods may be called.
Sourcepub fn write(self, old: FWO, new: FWN) -> Self
pub fn write(self, old: FWO, new: FWN) -> Self
Write can be used to configure the migration-write behavior of the resulting crate::Migrator instance.
Users are required to provide two different write methods – one to write to the old migration origin, and one to write to the new origin. Not every stage requires
Depending on the migration stage, one or both of these write methods may be called.
Auto Trait Implementations§
impl<P, T, FRO, FRN, FWO, FWN> Freeze for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> !RefUnwindSafe for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> Send for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> Sync for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> Unpin for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
impl<P, T, FRO, FRN, FWO, FWN> !UnwindSafe for MigratorBuilder<P, T, FRO, FRN, FWO, FWN>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more