Skip to content

Commit e05bd1d

Browse files
committed
gcoap.rs: Renames, prep
1 parent c459f09 commit e05bd1d

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/xbd-net/src/xbd/gcoap.rs

+6-5
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub fn gcoap_put(addr: &str, uri: &str, payload: &[u8]) -> impl Future<Output =
101101
#[repr(u8)]
102102
#[derive(Debug)]
103103
pub enum Req {
104-
GetBlockwise(ReqInner),
104+
BlockwiseGet(ReqInner),
105105
Get(ReqInner),
106106
Post(ReqInner),
107107
Put(ReqInner),
@@ -122,14 +122,14 @@ impl Req {
122122
pub fn blockwise_get_new(addr: &str, uri: &str, blockwise_state_index: usize) -> Self {
123123
let inner = ReqInner::new(COAP_METHOD_GET, addr, uri, None, true,
124124
Some(blockwise_state_index), None);
125-
Req::GetBlockwise(inner)
125+
Req::BlockwiseGet(inner)
126126
}
127127

128128
pub fn blockwise_get_next(addr: &str, uri: &str, blockwise_state_index: usize,
129129
blockwise_hdr: Vec<u8, BLOCKWISE_HDR_MAX>) -> Self {
130130
let inner = ReqInner::new(COAP_METHOD_GET, addr, uri, None, true,
131131
Some(blockwise_state_index), Some(blockwise_hdr));
132-
Req::GetBlockwise(inner)
132+
Req::BlockwiseGet(inner)
133133
}
134134
}
135135

@@ -140,7 +140,7 @@ impl Future for Req {
140140
// https://internals.rust-lang.org/t/idea-enhance-match-ergonomics-to-match-on-pinned-enums-without-unsafe/9317
141141
unsafe {
142142
match Pin::get_unchecked_mut(self) {
143-
Req::GetBlockwise(req) | Req::Get(req) | Req::Post(req) | Req::Put(req) =>
143+
Req::BlockwiseGet(req) | Req::Get(req) | Req::Post(req) | Req::Put(req) =>
144144
Pin::new_unchecked(req).poll(cx),
145145
}
146146
}
@@ -153,7 +153,7 @@ impl Future for Req {
153153
pub struct Progress<T>(Option<AtomicWaker>, pub Option<AtomicWaker>, pub Option<T>);
154154

155155
#[derive(Debug)]
156-
pub enum ProgressV2<T> {// !!!!
156+
pub enum FutureState<T> {// !!!!
157157
New,
158158
Registered,
159159
Resolved(T),
@@ -210,6 +210,7 @@ pub struct ReqInner {
210210
blockwise_state_index: Option<usize>,
211211
blockwise_hdr: Option<Vec<u8, BLOCKWISE_HDR_MAX>>,
212212
progress: Progress<GcoapMemoState>,
213+
// fstat: FutureState<GcoapMemoState>,
213214
}
214215

215216
impl ReqInner {

0 commit comments

Comments
 (0)