pub struct ArchiveRequest {
pub archive: bool,
pub target_status: Option<String>,
pub reason: Option<String>,
}Expand description
A request to delegate archiving to the #190 service.
A request, with no semantics of its own (contract §6): there is no
bulk-specific archive behaviour, and inventing one here would be the exact
“temporary archive behavior” the contract prohibits. WP05 builds the service
request; archive::apply_archive is where the delegation will happen.
§A restore carries an explicit target status
target_status and reason were absent from the first draft, and #190’s own
contract is what shows the gap:
Restore requires an explicit
target_status. A restore without one is rejected; there is no “restore to the previous status” behavior (C-003).
So a false-direction request with no target cannot be expressed at all. That is
the right shape: a request the service will refuse should not be constructible,
and a restore whose target is inferred from a stored previous status is exactly
the “restore to the previous status” behaviour C-003 rules out.
The fields are Option rather than a required-value-per-variant because a
request is also what a preview carries, and a preview must be able to say
“this restore is missing its target” rather than being unable to exist.
Fields§
§archive: booltrue archives, false restores.
target_status: Option<String>The column to restore into. Required when archive is false; ignored when
it is true, because archiving does not change status (C-001 in #190).
reason: Option<String>The user’s reason, preserved verbatim for the service’s record.
Implementations§
Source§impl ArchiveRequest
impl ArchiveRequest
Trait Implementations§
Source§impl Clone for ArchiveRequest
impl Clone for ArchiveRequest
Source§impl Debug for ArchiveRequest
impl Debug for ArchiveRequest
Source§impl<'de> Deserialize<'de> for ArchiveRequest
impl<'de> Deserialize<'de> for ArchiveRequest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for ArchiveRequest
Source§impl PartialEq for ArchiveRequest
impl PartialEq for ArchiveRequest
Source§impl Serialize for ArchiveRequest
impl Serialize for ArchiveRequest
impl StructuralPartialEq for ArchiveRequest
Auto Trait Implementations§
impl Freeze for ArchiveRequest
impl RefUnwindSafe for ArchiveRequest
impl Send for ArchiveRequest
impl Sync for ArchiveRequest
impl Unpin for ArchiveRequest
impl UnsafeUnpin for ArchiveRequest
impl UnwindSafe for ArchiveRequest
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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