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

Method add_post

examples/tonic_example/api/src/lib.rs:60–74  ·  view source on GitHub ↗
(&self, request: Request<Post>)

Source from the content-addressed store, hash-verified

58 }
59
60 async fn add_post(&self, request: Request<Post>) -> Result<Response<PostId>, Status> {
61 let conn = &self.connection;
62
63 let input = request.into_inner().into_model();
64
65 let inserted = Mutation::create_post(conn, input)
66 .await
67 .expect("could not insert post");
68
69 let response = PostId {
70 id: inserted.id.unwrap(),
71 };
72
73 Ok(Response::new(response))
74 }
75
76 async fn update_post(&self, request: Request<Post>) -> Result<Response<ProcessStatus>, Status> {
77 let conn = &self.connection;

Callers

nothing calls this directly

Calls 5

create_postFunction · 0.85
into_innerMethod · 0.80
unwrapMethod · 0.80
newFunction · 0.50
into_modelMethod · 0.45

Tested by

no test coverage detected