Skip to main content

SchemaMutation

Struct SchemaMutation 

Source
pub struct SchemaMutation {
    pub deleted: Vec<String>,
    pub clp: Option<ClassLevelPermissions>,
    pub set_fields: Vec<SetField>,
}
Expand description

A PUT /schemas/:className reduced to the work the caller has to do.

#[must_use], and deleted is not an Option. Both are deliberate: a caller that applies added and forgets deleted leaves a class carrying a field the client believes it removed, and the field then reappears in every response.

Fields§

§deleted: Vec<String>

Fields to drop, with their rows’ columns and, for a Relation, its join collection.

§clp: Option<ClassLevelPermissions>

None means the body carried no classLevelPermissions at all, which upstream treats as “leave the stored block alone” (setPermissions returns early on undefined, SchemaController.js:1097-1099). It is not the same as an empty block, which replaces the stored one.

§set_fields: Vec<SetField>

Every submitted field that is not a delete, in body order, with the options it carried.

Includes fields that already exist, and includes empty option sets, because both are meaningful. Upstream reaches enforceFieldExists for every submitted field, not only the new ones (SchemaController.js:930-934), and resubmitting a field without the options it was stored with is how a client clears them: updateFieldOptions writes whatever is left after type and targetClass are removed, which for {"type":"String"} is {} (MongoSchemaCollection.js:284-297).

Implementations§

Trait Implementations§

Source§

impl Clone for SchemaMutation

Source§

fn clone(&self) -> SchemaMutation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SchemaMutation

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V