MCPcopy Create free account
hub / github.com/SeaQL/sea-orm / try_set

Method try_set

src/entity/active_model.rs:90–93  ·  view source on GitHub ↗

Set the Value into an ActiveModel, return error if failed. This method is provided to prevent breaking changes, will be removed in next major version. The provided implementation will still panic. If you're using `DeriveActiveModel` then it's correctly implemented.

(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value)

Source from the content-addressed store, hash-verified

88 ///
89 /// If you're using `DeriveActiveModel` then it's correctly implemented.
90 fn try_set(&mut self, c: <Self::Entity as EntityTrait>::Column, v: Value) -> Result<(), DbErr> {
91 self.set(c, v);
92 Ok(())
93 }
94
95 /// Set the state of an [ActiveValue] to the not set state
96 fn not_set(&mut self, c: <Self::Entity as EntityTrait>::Column);

Callers 1

setMethod · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected