pub struct VersionConflict {
pub expected: ScimVersion,
pub current: ScimVersion,
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.
§Examples
use scim_server::resource::version::{VersionConflict, ScimVersion};
let conflict = VersionConflict {
expected: ScimVersion::from_hash("1"),
current: ScimVersion::from_hash("2"),
message: "Resource was modified by another client".to_string(),
};Fields§
§expected: ScimVersionThe version that was expected by the client
current: ScimVersionThe current version of the resource on the server
message: StringHuman-readable error message describing the conflict
Implementations§
Source§impl VersionConflict
impl VersionConflict
Sourcepub fn new(
expected: ScimVersion,
current: ScimVersion,
message: impl Into<String>,
) -> Self
pub fn new( expected: ScimVersion, current: ScimVersion, message: impl Into<String>, ) -> Self
Create a new version conflict.
§Arguments
expected- The version expected by the clientcurrent- The current version on the servermessage- Human-readable error message
Sourcepub fn standard_message(expected: ScimVersion, current: ScimVersion) -> Self
pub fn standard_message(expected: ScimVersion, current: ScimVersion) -> Self
Create a standard version conflict message.
§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 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> 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.