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

Method list

examples/jsonrpsee_example/api/src/lib.rs:46–58  ·  view source on GitHub ↗
(
        &self,
        page: Option<u64>,
        posts_per_page: Option<u64>,
    )

Source from the content-addressed store, hash-verified

44#[async_trait]
45impl PostRpcServer for PpcImpl {
46 async fn list(
47 &self,
48 page: Option<u64>,
49 posts_per_page: Option<u64>,
50 ) -> RpcResult<Vec<post::Model>> {
51 let page = page.unwrap_or(1);
52 let posts_per_page = posts_per_page.unwrap_or(DEFAULT_POSTS_PER_PAGE);
53
54 Query::find_posts_in_page(&self.conn, page, posts_per_page)
55 .await
56 .map(|(p, _)| p)
57 .internal_call_error()
58 }
59
60 async fn insert(&self, p: post::Model) -> RpcResult<i32> {
61 let new_post = Mutation::create_post(&self.conn, p)

Callers

nothing calls this directly

Calls 1

internal_call_errorMethod · 0.80

Tested by

no test coverage detected