Skip to content

Commit 2194e99

Browse files
kashifsoofiiinuwa
authored andcommitted
daemon: Rename initiate_event_stream to subscribe
1 parent ea0347c commit 2194e99

File tree

6 files changed

+10
-10
lines changed

6 files changed

+10
-10
lines changed

credentialsd-common/src/client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub trait FlowController {
1515

1616
fn get_hybrid_credential(&mut self) -> impl Future<Output = Result<(), ()>> + Send;
1717
fn get_usb_credential(&mut self) -> impl Future<Output = Result<(), ()>> + Send;
18-
fn initiate_event_stream(
18+
fn subscribe(
1919
&mut self,
2020
) -> impl Future<
2121
Output = Result<Pin<Box<dyn Stream<Item = BackgroundEvent> + Send + 'static>>, ()>,

credentialsd-ui/src/client.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ impl FlowController for DbusCredentialClient {
5353
.map_err(|_| ())
5454
}
5555

56-
async fn initiate_event_stream(
56+
async fn subscribe(
5757
&mut self,
5858
) -> std::result::Result<
5959
std::pin::Pin<
@@ -80,7 +80,7 @@ impl FlowController for DbusCredentialClient {
8080
.boxed();
8181
self.proxy()
8282
.await?
83-
.initiate_event_stream()
83+
.subscribe()
8484
.await
8585
.map_err(|err| tracing::error!("Failed to initialize event stream: {err}"))
8686
.map(|_| stream)

credentialsd-ui/src/dbus.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use zbus::{fdo, interface, proxy};
99
default_service = "xyz.iinuwa.credentialsd.FlowControl"
1010
)]
1111
pub trait FlowControlService {
12-
async fn initiate_event_stream(&self) -> fdo::Result<()>;
12+
async fn subscribe(&self) -> fdo::Result<()>;
1313

1414
async fn get_available_public_key_devices(&self) -> fdo::Result<Vec<Device>>;
1515

credentialsd-ui/src/gui/view_model/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ impl<F: FlowController + Send> ViewModel<F> {
133133
let view_events = self.rx_event.clone().map(Event::View);
134134
let bg_events = {
135135
let mut cred_service = self.flow_controller.lock().await;
136-
cred_service.initiate_event_stream().await.unwrap()
136+
cred_service.subscribe().await.unwrap()
137137
};
138138
let mut all_events = view_events.merge(bg_events.map(Event::Background));
139139
while let Some(event) = all_events.next().await {

credentialsd/src/dbus/flow_control.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ where
9898
U: UsbHandler + Debug + Send + Sync + 'static,
9999
UC: UiController + Debug + Send + Sync + 'static,
100100
{
101-
async fn initiate_event_stream(
101+
async fn subscribe(
102102
&self,
103103
#[zbus(signal_emitter)] emitter: SignalEmitter<'_>,
104104
) -> fdo::Result<()> {
@@ -434,7 +434,7 @@ pub mod test {
434434
}
435435
}
436436

437-
async fn initiate_event_stream(
437+
async fn subscribe(
438438
&mut self,
439439
) -> Result<Pin<Box<dyn Stream<Item = BackgroundEvent> + Send + 'static>>, ()> {
440440
if let Ok(DummyFlowResponse::InitStream(Ok(stream))) =
@@ -542,7 +542,7 @@ pub mod test {
542542
DummyFlowResponse::GetUsbCredential
543543
}
544544
DummyFlowRequest::InitStream => {
545-
let rsp = self.initiate_event_stream().await;
545+
let rsp = self.subscribe().await;
546546
DummyFlowResponse::InitStream(rsp)
547547
}
548548
};
@@ -644,7 +644,7 @@ pub mod test {
644644
Ok(())
645645
}
646646

647-
async fn initiate_event_stream(
647+
async fn subscribe(
648648
&mut self,
649649
) -> Result<Pin<Box<dyn Stream<Item = BackgroundEvent> + Send + 'static>>, ()> {
650650
let (tx, mut rx) = mpsc::channel(32);

credentialsd/src/dbus/ui_control.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ pub mod test {
202202
.await
203203
.as_mut()
204204
.unwrap()
205-
.initiate_event_stream()
205+
.subscribe()
206206
.await
207207
.unwrap();
208208
self.stream_initialized.store(true, Ordering::Release);

0 commit comments

Comments
 (0)