Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeviceRequest::stop is pub #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/device/request.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl<'a> DeviceRequest<'a> {
///
/// 停止は重要な操作であり、実行は`Device`インスタンスの保持者に制限したいので、
/// このメソッドは`crate`のみを公開範囲とする.
pub(crate) fn stop(&self) {
pub fn stop(&self) {
Copy link
Contributor

Choose a reason for hiding this comment

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

DeviceRegistryHandle に stop するインターフェースを追加すれば十分でこのメソッドを pub にする必要はないんじゃないかと思いますがどうでしょうか?

もしかしたら delete_device してしまう方法でも十分かもしれません。

https://github.com/frugalos/cannyls_rpc/blob/66d9f9caae130eb1caa6534ec165b9758593ac7b/src/registry.rs#L171

let deadline = self.deadline.unwrap_or_default();
let command = command::StopDevice::new(deadline);
self.send_command(Command::Stop(command));
Expand Down