Skip to content

feat(sails): Allows to return value with reply from a service#522

Merged
vobradovich merged 15 commits into
masterfrom
vo/reply-with-value
Sep 20, 2024
Merged

feat(sails): Allows to return value with reply from a service#522
vobradovich merged 15 commits into
masterfrom
vo/reply-with-value

Conversation

@vobradovich
Copy link
Copy Markdown
Member

@vobradovich vobradovich commented Sep 11, 2024

Resolves #475 .

Introduces special case for handling a CommandReply<T> as a result type and extracting a value

@vobradovich vobradovich self-assigned this Sep 11, 2024
@vobradovich vobradovich marked this pull request as ready for review September 13, 2024 11:58
@vobradovich
Copy link
Copy Markdown
Member Author

Awaiting review. Don't merge!

Copy link
Copy Markdown
Contributor

@DennisInSky DennisInSky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current impl doesn't prevent returning CommandResult from queries

pub fn query(&self) -> CommandResult<u128> {
    (123, 100_500).into()
}

Comment thread rs/src/gstd/mod.rs Outdated
Comment thread rs/src/gstd/mod.rs
Comment thread rs/src/gstd/mod.rs Outdated
Comment thread rs/macros/core/src/shared.rs Outdated
@breathx
Copy link
Copy Markdown
Member

breathx commented Sep 20, 2024

Current impl doesn't prevent returning CommandResult from queries

pub fn query(&self) -> CommandResult<u128> {
    (123, 100_500).into()
}

Is it necessary to forbid?

Comment thread rs/src/gstd/mod.rs
Comment thread rs/src/gstd/mod.rs Outdated
Comment thread rs/macros/core/src/service/mod.rs
Comment thread rs/macros/tests/ui/gservice_fails_query_reply_with_value.stderr Outdated
Comment thread rs/macros/core/src/shared.rs
Comment thread rs/macros/core/src/service/mod.rs
Comment thread rs/macros/core/src/program/mod.rs Outdated
@vobradovich vobradovich merged commit 41c1e20 into master Sep 20, 2024
@vobradovich vobradovich deleted the vo/reply-with-value branch September 20, 2024 16:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

How to reply with value

3 participants