Skip to content

Commit

Permalink
moved doc comments from impl to trait
Browse files Browse the repository at this point in the history
  • Loading branch information
Uewotm90 committed Dec 11, 2023
1 parent fc82aa4 commit 9e3d85f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
11 changes: 8 additions & 3 deletions src/controllers/controller_impls/reveaal_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,19 @@ impl EcdarBackend for ReveaalController {
) -> Result<Response<UserTokenResponse>, Status> {
self.services.reveaal_service.get_user_token(request).await
}

/// Forwards the query to the Reveaal backend
/// # Errors
/// Errors when Reveaal backend errors
async fn send_query(
&self,
request: Request<QueryRequest>,
) -> Result<Response<QueryResponse>, Status> {
self.services.reveaal_service.send_query(request).await
}

/// Forwards the query to the Reveaal backend
/// # Errors
/// Errors when Reveaal backend errors
//TODO Bedre doc comment
async fn start_simulation(
&self,
request: Request<SimulationStartRequest>,
Expand All @@ -42,7 +47,7 @@ impl EcdarBackend for ReveaalController {
.start_simulation(request)
.await
}

//TODO Bedre doc comment
async fn take_simulation_step(
&self,
request: Request<SimulationStepRequest>,
Expand Down
9 changes: 0 additions & 9 deletions src/controllers/controller_impls/session_controller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ impl SessionController {

#[async_trait]
impl SessionControllerTrait for SessionController {
/// Deletes the requester's session, found by their access token.
///
/// Returns the response that is received from Reveaal.
async fn delete_session(&self, request: Request<()>) -> Result<Response<()>, Status> {
let access_token = request
.token_string()
Expand All @@ -105,12 +102,6 @@ impl SessionControllerTrait for SessionController {
}
}

/// This method is used to get a new access and refresh token for a user.
///
/// # Errors
/// This function will return an error if the user does not exist in the contexts,
/// if the password in the request does not match the user's password,
/// or if no user is provided in the request.
async fn get_auth_token(
&self,
request: Request<GetAuthTokenRequest>,
Expand Down
10 changes: 10 additions & 0 deletions src/controllers/controller_traits/session_controller_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,17 @@ use tonic::{Request, Response, Status};

#[async_trait]
pub trait SessionControllerTrait: Send + Sync {
/// Deletes the requester's session, found by their access token.
///
/// Returns the response that is received from Reveaal.
async fn delete_session(&self, _request: Request<()>) -> Result<Response<()>, Status>;

/// This method is used to get a new access and refresh token for a user.
///
/// # Errors
/// This function will return an error if the user does not exist in the contexts,
/// if the password in the request does not match the user's password,
/// or if no user is provided in the request.
async fn get_auth_token(
&self,
request: Request<GetAuthTokenRequest>,
Expand Down

0 comments on commit 9e3d85f

Please sign in to comment.