pub struct OneOfValidator;Expand description
Validates that exactly one field from the specified set is provided.
§Example
use fraiseql_core::validation::mutual_exclusivity::OneOfValidator;
use serde_json::json;
// Either entityId OR entityPayload, but not both
let input = json!({ "entityId": "123", "entityPayload": null });
assert!(
OneOfValidator::validate(&input, &["entityId".to_string(), "entityPayload".to_string()], None).is_ok(),
"one-of constraint satisfied when only entityId is present"
);Implementations§
Auto Trait Implementations§
impl Freeze for OneOfValidator
impl RefUnwindSafe for OneOfValidator
impl Send for OneOfValidator
impl Sync for OneOfValidator
impl Unpin for OneOfValidator
impl UnsafeUnpin for OneOfValidator
impl UnwindSafe for OneOfValidator
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