pub struct VersionConflict {
pub expected: RawVersion,
pub current: RawVersion,
pub message: String,
}Expand description
Details about a version conflict during a conditional operation.
Provides information about the expected version (from the client)
and the current version (from the server), along with a human-readable
error message. Uses RawVersion internally for consistent storage
and comparison.
§Examples
use scim_server::resource::version::{VersionConflict, RawVersion};
let expected = RawVersion::from_hash("1");
let current = RawVersion::from_hash("2");
let conflict = VersionConflict {
expected,
current,
message: "Resource was modified by another client".to_string(),
};Fields§
§expected: RawVersionThe version that was expected by the client (raw format)
current: RawVersionThe current version of the resource on the server (raw format)
message: StringHuman-readable error message describing the conflict
Implementations§
Source§impl VersionConflict
impl VersionConflict
Sourcepub fn new<E, C>(expected: E, current: C, message: impl Into<String>) -> Self
pub fn new<E, C>(expected: E, current: C, message: impl Into<String>) -> Self
Create a new version conflict.
Accepts versions in any format and converts to raw format for internal storage.
§Arguments
expected- The version expected by the clientcurrent- The current version on the servermessage- Human-readable error message
Sourcepub fn standard_message<E, C>(expected: E, current: C) -> Self
pub fn standard_message<E, C>(expected: E, current: C) -> Self
Create a standard version conflict message.
Accepts versions in any format and converts to raw format for internal storage.
§Arguments
expected- The version expected by the clientcurrent- The current version on the server
Trait Implementations§
Source§impl Clone for VersionConflict
impl Clone for VersionConflict
Source§fn clone(&self) -> VersionConflict
fn clone(&self) -> VersionConflict
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VersionConflict
impl Debug for VersionConflict
Source§impl<'de> Deserialize<'de> for VersionConflict
impl<'de> Deserialize<'de> for VersionConflict
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for VersionConflict
impl Display for VersionConflict
Source§impl Error for VersionConflict
impl Error for VersionConflict
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<VersionConflict> for ProviderError
impl From<VersionConflict> for ProviderError
Source§fn from(source: VersionConflict) -> Self
fn from(source: VersionConflict) -> Self
Converts to this type from the input type.
Source§impl PartialEq for VersionConflict
impl PartialEq for VersionConflict
Source§impl Serialize for VersionConflict
impl Serialize for VersionConflict
impl StructuralPartialEq for VersionConflict
Auto Trait Implementations§
impl Freeze for VersionConflict
impl RefUnwindSafe for VersionConflict
impl Send for VersionConflict
impl Sync for VersionConflict
impl Unpin for VersionConflict
impl UnwindSafe for VersionConflict
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 moreSource§impl<T> TenantValidator for T
impl<T> TenantValidator for T
Source§fn validate_tenant_context(
&self,
expected_tenant_id: &str,
context: &RequestContext,
) -> Result<(), String>
fn validate_tenant_context( &self, expected_tenant_id: &str, context: &RequestContext, ) -> Result<(), String>
Validate that the context has the expected tenant.
Source§fn validate_single_tenant_context(
&self,
context: &RequestContext,
) -> Result<(), String>
fn validate_single_tenant_context( &self, context: &RequestContext, ) -> Result<(), String>
Validate that the context is for single-tenant operation.
Source§fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
fn require_tenant_context(&self, context: &RequestContext) -> Result<(), String>
Extract tenant context or return error for multi-tenant operations.