Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Blocking takes a u64 For index but ApiResponse returns a string #26

@jgould22

Description

@jgould22

I am trying to make some blocking calls against the key value store to keep a watch on a value.

This means I need to make requests with the index Blocking feature set.

I am using the below

https://docs.rs/consulrs/latest/consulrs/api/features/struct.Blocking.html

https://docs.rs/consulrs/latest/consulrs/api/struct.ApiResponse.html

                let mut res = consulrs::kv::read(
                    &consul_client,
                    &key,
                    Some(
                        ReadKeyRequestBuilder::default()
                            .key(&key)
                            .features(
                                consulrs::api::features::Features {
                                    blocking: Some(consulrs::api::features::Blocking {
                                        index:my_index,
                                        wait: Some("500s".to_string()),
                                    }),
                                    ..consulrs::api::features::Features::default()
                                }
                            )
                            .recurse(false),
                    ),
                )
                .await;

Is there an easier way to do this without having to convert the index to a string or u64 in the request response loop.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions