mirror of
https://github.com/deuxfleurs-org/garage.git
synced 2026-08-13 07:46:51 +00:00
support redirection on s3 endpoint
This commit is contained in:
committed by
Alex Auvolat
parent
c834f3f024
commit
0a48d504fe
@@ -9,6 +9,16 @@ pub enum Deletable<T> {
|
||||
Deleted,
|
||||
}
|
||||
|
||||
impl<T> Deletable<T> {
|
||||
/// Map value, used for migrations
|
||||
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Deletable<U> {
|
||||
match self {
|
||||
Self::Present(x) => Deletable::<U>::Present(f(x)),
|
||||
Self::Deleted => Deletable::<U>::Deleted,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Crdt> Deletable<T> {
|
||||
/// Create a new deletable object that isn't deleted
|
||||
pub fn present(v: T) -> Self {
|
||||
|
||||
@@ -43,6 +43,16 @@ pub struct Lww<T> {
|
||||
v: T,
|
||||
}
|
||||
|
||||
impl<T> Lww<T> {
|
||||
/// Map value, used for migrations
|
||||
pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Lww<U> {
|
||||
Lww::<U> {
|
||||
ts: self.ts,
|
||||
v: f(self.v),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Lww<T>
|
||||
where
|
||||
T: Crdt,
|
||||
|
||||
Reference in New Issue
Block a user