tangled
alpha
login
or
join now
tsiry-sandratraina.com
/
tunein-cli
6
fork
atom
Browse and listen to thousands of radio stations across the globe right from your terminal ๐ ๐ป ๐ตโจ
radio
rust
tokio
web-radio
command-line-tool
tui
6
fork
atom
overview
issues
pulls
pipelines
bump version code
tsiry-sandratraina.com
6 months ago
ef0ae159
fe119abb
0/1
fmt.yml
failed
12s
+347
-153
8 changed files
expand all
collapse all
unified
split
Cargo.lock
Cargo.toml
README.md
dist
debian
amd64
DEBIAN
control
arm64
DEBIAN
control
rpm
amd64
tunein.spec
arm64
tunein.spec
src
api
tunein.v1alpha1.rs
+74
-14
Cargo.lock
···
850
850
"once_cell",
851
851
"parking_lot",
852
852
"stdweb",
853
853
-
"thiserror",
853
853
+
"thiserror 1.0.69",
854
854
"web-sys",
855
855
"windows",
856
856
]
···
1407
1407
"ipnet",
1408
1408
"once_cell",
1409
1409
"rand 0.8.5",
1410
1410
-
"thiserror",
1410
1410
+
"thiserror 1.0.69",
1411
1411
"tinyvec",
1412
1412
"tracing",
1413
1413
"url 2.5.4",
···
1429
1429
"rand 0.8.5",
1430
1430
"resolv-conf",
1431
1431
"smallvec",
1432
1432
-
"thiserror",
1432
1432
+
"thiserror 1.0.69",
1433
1433
"tracing",
1434
1434
]
1435
1435
···
1941
1941
"combine",
1942
1942
"jni-sys",
1943
1943
"log",
1944
1944
-
"thiserror",
1944
1944
+
"thiserror 1.0.69",
1945
1945
"walkdir",
1946
1946
]
1947
1947
···
2116
2116
]
2117
2117
2118
2118
[[package]]
2119
2119
+
name = "mach2"
2120
2120
+
version = "0.4.3"
2121
2121
+
source = "registry+https://github.com/rust-lang/crates.io-index"
2122
2122
+
checksum = "d640282b302c0bb0a2a8e0233ead9035e3bed871f0b7e81fe4a1ec829765db44"
2123
2123
+
dependencies = [
2124
2124
+
"libc",
2125
2125
+
]
2126
2126
+
2127
2127
+
[[package]]
2119
2128
name = "match_cfg"
2120
2129
version = "0.1.0"
2121
2130
source = "registry+https://github.com/rust-lang/crates.io-index"
···
2176
2185
source = "registry+https://github.com/rust-lang/crates.io-index"
2177
2186
checksum = "985438f75febf74c392071a975a29641b420dd84431135a6e6db721de4b74372"
2178
2187
dependencies = [
2179
2179
-
"minimp3-sys",
2188
2188
+
"minimp3-sys 0.3.2",
2180
2189
"slice-deque",
2181
2181
-
"thiserror",
2190
2190
+
"thiserror 1.0.69",
2191
2191
+
]
2192
2192
+
2193
2193
+
[[package]]
2194
2194
+
name = "minimp3"
2195
2195
+
version = "0.6.0"
2196
2196
+
source = "registry+https://github.com/rust-lang/crates.io-index"
2197
2197
+
checksum = "c684a06335e480df3f2aa78970d0d470835716ae5867d5dadb71ef9f4413572d"
2198
2198
+
dependencies = [
2199
2199
+
"minimp3-sys 0.6.0",
2200
2200
+
"slice-ring-buffer",
2201
2201
+
"thiserror 2.0.14",
2182
2202
]
2183
2203
2184
2204
[[package]]
···
2186
2206
version = "0.3.2"
2187
2207
source = "registry+https://github.com/rust-lang/crates.io-index"
2188
2208
checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90"
2209
2209
+
dependencies = [
2210
2210
+
"cc",
2211
2211
+
]
2212
2212
+
2213
2213
+
[[package]]
2214
2214
+
name = "minimp3-sys"
2215
2215
+
version = "0.6.0"
2216
2216
+
source = "registry+https://github.com/rust-lang/crates.io-index"
2217
2217
+
checksum = "aa16a1fbac806d94e230e0a6b9b5a137d051897a188944cf07645da4b73a9fae"
2189
2218
dependencies = [
2190
2219
"cc",
2191
2220
]
···
2238
2267
"jni-sys",
2239
2268
"ndk-sys 0.3.0",
2240
2269
"num_enum",
2241
2241
-
"thiserror",
2270
2270
+
"thiserror 1.0.69",
2242
2271
]
2243
2272
2244
2273
[[package]]
···
2252
2281
"ndk-sys 0.4.1+23.1.7779620",
2253
2282
"num_enum",
2254
2283
"raw-window-handle",
2255
2255
-
"thiserror",
2284
2284
+
"thiserror 1.0.69",
2256
2285
]
2257
2286
2258
2287
[[package]]
···
2986
3015
"cpal",
2987
3016
"hound",
2988
3017
"lewton",
2989
2989
-
"minimp3",
3018
3018
+
"minimp3 0.5.1",
2990
3019
]
2991
3020
2992
3021
[[package]]
···
3219
3248
dependencies = [
3220
3249
"percent-encoding 2.3.1",
3221
3250
"serde",
3222
3222
-
"thiserror",
3251
3251
+
"thiserror 1.0.69",
3223
3252
]
3224
3253
3225
3254
[[package]]
···
3319
3348
]
3320
3349
3321
3350
[[package]]
3351
3351
+
name = "slice-ring-buffer"
3352
3352
+
version = "0.3.4"
3353
3353
+
source = "registry+https://github.com/rust-lang/crates.io-index"
3354
3354
+
checksum = "84ae312bda09b2368f79f985fdb4df4a0b5cbc75546b511303972d195f8c27d6"
3355
3355
+
dependencies = [
3356
3356
+
"libc",
3357
3357
+
"mach2",
3358
3358
+
"winapi",
3359
3359
+
]
3360
3360
+
3361
3361
+
[[package]]
3322
3362
name = "smallvec"
3323
3363
version = "1.13.2"
3324
3364
source = "registry+https://github.com/rust-lang/crates.io-index"
···
3794
3834
source = "registry+https://github.com/rust-lang/crates.io-index"
3795
3835
checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52"
3796
3836
dependencies = [
3797
3797
-
"thiserror-impl",
3837
3837
+
"thiserror-impl 1.0.69",
3838
3838
+
]
3839
3839
+
3840
3840
+
[[package]]
3841
3841
+
name = "thiserror"
3842
3842
+
version = "2.0.14"
3843
3843
+
source = "registry+https://github.com/rust-lang/crates.io-index"
3844
3844
+
checksum = "0b0949c3a6c842cbde3f1686d6eea5a010516deb7085f79db747562d4102f41e"
3845
3845
+
dependencies = [
3846
3846
+
"thiserror-impl 2.0.14",
3798
3847
]
3799
3848
3800
3849
[[package]]
···
3802
3851
version = "1.0.69"
3803
3852
source = "registry+https://github.com/rust-lang/crates.io-index"
3804
3853
checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1"
3854
3854
+
dependencies = [
3855
3855
+
"proc-macro2",
3856
3856
+
"quote",
3857
3857
+
"syn 2.0.96",
3858
3858
+
]
3859
3859
+
3860
3860
+
[[package]]
3861
3861
+
name = "thiserror-impl"
3862
3862
+
version = "2.0.14"
3863
3863
+
source = "registry+https://github.com/rust-lang/crates.io-index"
3864
3864
+
checksum = "cc5b44b4ab9c2fdd0e0512e6bece8388e214c0749f5862b114cc5b7a25daf227"
3805
3865
dependencies = [
3806
3866
"proc-macro2",
3807
3867
"quote",
···
4152
4212
4153
4213
[[package]]
4154
4214
name = "tunein-cli"
4155
4155
-
version = "0.3.1"
4215
4215
+
version = "0.3.2"
4156
4216
dependencies = [
4157
4217
"anyhow",
4158
4218
"async-trait",
···
4164
4224
"futures-util",
4165
4225
"hyper 0.14.32",
4166
4226
"m3u",
4167
4167
-
"minimp3",
4227
4227
+
"minimp3 0.6.0",
4168
4228
"owo-colors",
4169
4229
"pls",
4170
4230
"prost",
···
4178
4238
"surf",
4179
4239
"symphonia",
4180
4240
"termion",
4181
4181
-
"thiserror",
4241
4241
+
"thiserror 1.0.69",
4182
4242
"tokio",
4183
4243
"tonic",
4184
4244
"tonic-build",
+32
-8
Cargo.toml
···
8
8
name = "tunein-cli"
9
9
readme = "README.md"
10
10
repository = "https://github.com/tsirysndr/tunein-cli"
11
11
-
version = "0.3.1"
11
11
+
version = "0.3.2"
12
12
13
13
[[bin]]
14
14
name = "tunein"
···
31
31
derive_more = "0.99.17"
32
32
futures = "0.3.26"
33
33
futures-util = "0.3.26"
34
34
-
hyper = {version = "0.14.23", features = ["client", "stream", "tcp", "http1", "http2"]}
34
34
+
hyper = { version = "0.14.23", features = [
35
35
+
"client",
36
36
+
"stream",
37
37
+
"tcp",
38
38
+
"http1",
39
39
+
"http2",
40
40
+
] }
35
41
m3u = "1.0.0"
36
42
minimp3 = "0.6"
37
43
owo-colors = "3.5.0"
38
44
pls = "0.2.2"
39
45
prost = "0.13.2"
40
40
-
radiobrowser = { version = "0.6.1", features = ["default-rustls"], default-features = false }
46
46
+
radiobrowser = { version = "0.6.1", features = [
47
47
+
"default-rustls",
48
48
+
], default-features = false }
41
49
ratatui = "0.26.1"
42
50
regex = "1.11.1"
43
43
-
reqwest = {version = "0.11.14", features = ["blocking", "rustls-tls"], default-features = false}
44
44
-
rodio = {version = "0.16"}
51
51
+
reqwest = { version = "0.11.14", features = [
52
52
+
"blocking",
53
53
+
"rustls-tls",
54
54
+
], default-features = false }
55
55
+
rodio = { version = "0.16" }
45
56
rustfft = "6.2.0"
46
57
serde = "1.0.197"
47
47
-
surf = {version = "2.3.2", features = ["h1-client-rustls"], default-features = false}
48
48
-
symphonia = {version = "0.5.1", features = ["aac", "alac", "mp3", "isomp4", "flac"]}
58
58
+
surf = { version = "2.3.2", features = [
59
59
+
"h1-client-rustls",
60
60
+
], default-features = false }
61
61
+
symphonia = { version = "0.5.1", features = [
62
62
+
"aac",
63
63
+
"alac",
64
64
+
"mp3",
65
65
+
"isomp4",
66
66
+
"flac",
67
67
+
] }
49
68
termion = "2.0.1"
50
69
thiserror = "1.0.58"
51
51
-
tokio = {version = "1.36.0", features = ["tokio-macros", "macros", "rt", "rt-multi-thread"]}
70
70
+
tokio = { version = "1.36.0", features = [
71
71
+
"tokio-macros",
72
72
+
"macros",
73
73
+
"rt",
74
74
+
"rt-multi-thread",
75
75
+
] }
52
76
tonic = "0.12.3"
53
77
tonic-reflection = "0.12.3"
54
78
tonic-web = "0.12.3"
+2
-2
README.md
···
108
108
Or download the latest release for your platform [here](https://github.com/tsirysndr/tunein-cli/releases).
109
109
110
110
## ๐ฆ Downloads
111
111
-
- `Mac`: arm64: [tunein_v0.3.1_aarch64-apple-darwin.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.1/tunein_v0.3.1_aarch64-apple-darwin.tar.gz) intel: [tunein_v0.3.1_x86_64-apple-darwin.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.1/tunein_v0.3.1_x86_64-apple-darwin.tar.gz)
112
112
-
- `Linux`: [tunein_v0.3.1_x86_64-unknown-linux-gnu.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.1/tunein_v0.3.1_x86_64-unknown-linux-gnu.tar.gz)
111
111
+
- `Mac`: arm64: [tunein_v0.3.2_aarch64-apple-darwin.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.2/tunein_v0.3.2_aarch64-apple-darwin.tar.gz) intel: [tunein_v0.3.2_x86_64-apple-darwin.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.2/tunein_v0.3.2_x86_64-apple-darwin.tar.gz)
112
112
+
- `Linux`: [tunein_v0.3.2_x86_64-unknown-linux-gnu.tar.gz](https://github.com/tsirysndr/tunein-cli/releases/download/v0.3.2/tunein_v0.3.2_x86_64-unknown-linux-gnu.tar.gz)
113
113
114
114
## ๐ Usage
115
115
```
+1
-1
dist/debian/amd64/DEBIAN/control
···
1
1
Package: tunein-cli
2
2
-
Version: 0.3.1
2
2
+
Version: 0.3.2
3
3
Section: user/multimedia
4
4
Priority: optional
5
5
Architecture: amd64
+1
-1
dist/debian/arm64/DEBIAN/control
···
1
1
Package: tunein-cli
2
2
-
Version: 0.3.1
2
2
+
Version: 0.3.2
3
3
Section: user/multimedia
4
4
Priority: optional
5
5
Architecture: arm64
+1
-1
dist/rpm/amd64/tunein.spec
···
1
1
Name: tunein-cli
2
2
-
Version: 0.3.1
2
2
+
Version: 0.3.2
3
3
Release: 1%{?dist}
4
4
Summary: CLI for listening to internet radio stations
5
5
+1
-1
dist/rpm/arm64/tunein.spec
···
1
1
2
2
Name: tunein-cli
3
3
-
Version: 0.3.1
3
3
+
Version: 0.3.2
4
4
Release: 1%{?dist}
5
5
Summary: CLI for listening to internet radio stations
6
6
+235
-125
src/api/tunein.v1alpha1.rs
···
39
39
#[derive(Clone, PartialEq, ::prost::Message)]
40
40
pub struct GetStationDetailsResponse {
41
41
#[prost(message, optional, tag = "1")]
42
42
-
pub station_link_details:
43
43
-
::core::option::Option<super::super::objects::v1alpha1::StationLinkDetails>,
42
42
+
pub station_link_details: ::core::option::Option<
43
43
+
super::super::objects::v1alpha1::StationLinkDetails,
44
44
+
>,
44
45
}
45
46
#[derive(Clone, PartialEq, ::prost::Message)]
46
47
pub struct SearchRequest {
···
61
62
dead_code,
62
63
missing_docs,
63
64
clippy::wildcard_imports,
64
64
-
clippy::let_unit_value
65
65
+
clippy::let_unit_value,
65
66
)]
66
66
-
use tonic::codegen::http::Uri;
67
67
use tonic::codegen::*;
68
68
+
use tonic::codegen::http::Uri;
68
69
#[derive(Debug, Clone)]
69
70
pub struct BrowseServiceClient<T> {
70
71
inner: tonic::client::Grpc<T>,
···
108
109
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
109
110
>,
110
111
>,
111
111
-
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
112
112
-
Into<StdError> + std::marker::Send + std::marker::Sync,
112
112
+
<T as tonic::codegen::Service<
113
113
+
http::Request<tonic::body::BoxBody>,
114
114
+
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
113
115
{
114
116
BrowseServiceClient::new(InterceptedService::new(inner, interceptor))
115
117
}
···
147
149
pub async fn get_categories(
148
150
&mut self,
149
151
request: impl tonic::IntoRequest<super::GetCategoriesRequest>,
150
150
-
) -> std::result::Result<tonic::Response<super::GetCategoriesResponse>, tonic::Status>
151
151
-
{
152
152
-
self.inner.ready().await.map_err(|e| {
153
153
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
154
154
-
})?;
152
152
+
) -> std::result::Result<
153
153
+
tonic::Response<super::GetCategoriesResponse>,
154
154
+
tonic::Status,
155
155
+
> {
156
156
+
self.inner
157
157
+
.ready()
158
158
+
.await
159
159
+
.map_err(|e| {
160
160
+
tonic::Status::unknown(
161
161
+
format!("Service was not ready: {}", e.into()),
162
162
+
)
163
163
+
})?;
155
164
let codec = tonic::codec::ProstCodec::default();
156
165
let path = http::uri::PathAndQuery::from_static(
157
166
"/tunein.v1alpha1.BrowseService/GetCategories",
158
167
);
159
168
let mut req = request.into_request();
160
160
-
req.extensions_mut().insert(GrpcMethod::new(
161
161
-
"tunein.v1alpha1.BrowseService",
162
162
-
"GetCategories",
163
163
-
));
169
169
+
req.extensions_mut()
170
170
+
.insert(
171
171
+
GrpcMethod::new("tunein.v1alpha1.BrowseService", "GetCategories"),
172
172
+
);
164
173
self.inner.unary(req, path, codec).await
165
174
}
166
175
pub async fn browse_category(
167
176
&mut self,
168
177
request: impl tonic::IntoRequest<super::BrowseCategoryRequest>,
169
169
-
) -> std::result::Result<tonic::Response<super::BrowseCategoryResponse>, tonic::Status>
170
170
-
{
171
171
-
self.inner.ready().await.map_err(|e| {
172
172
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
173
173
-
})?;
178
178
+
) -> std::result::Result<
179
179
+
tonic::Response<super::BrowseCategoryResponse>,
180
180
+
tonic::Status,
181
181
+
> {
182
182
+
self.inner
183
183
+
.ready()
184
184
+
.await
185
185
+
.map_err(|e| {
186
186
+
tonic::Status::unknown(
187
187
+
format!("Service was not ready: {}", e.into()),
188
188
+
)
189
189
+
})?;
174
190
let codec = tonic::codec::ProstCodec::default();
175
191
let path = http::uri::PathAndQuery::from_static(
176
192
"/tunein.v1alpha1.BrowseService/BrowseCategory",
177
193
);
178
194
let mut req = request.into_request();
179
179
-
req.extensions_mut().insert(GrpcMethod::new(
180
180
-
"tunein.v1alpha1.BrowseService",
181
181
-
"BrowseCategory",
182
182
-
));
195
195
+
req.extensions_mut()
196
196
+
.insert(
197
197
+
GrpcMethod::new("tunein.v1alpha1.BrowseService", "BrowseCategory"),
198
198
+
);
183
199
self.inner.unary(req, path, codec).await
184
200
}
185
201
pub async fn get_station_details(
186
202
&mut self,
187
203
request: impl tonic::IntoRequest<super::GetStationDetailsRequest>,
188
188
-
) -> std::result::Result<tonic::Response<super::GetStationDetailsResponse>, tonic::Status>
189
189
-
{
190
190
-
self.inner.ready().await.map_err(|e| {
191
191
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
192
192
-
})?;
204
204
+
) -> std::result::Result<
205
205
+
tonic::Response<super::GetStationDetailsResponse>,
206
206
+
tonic::Status,
207
207
+
> {
208
208
+
self.inner
209
209
+
.ready()
210
210
+
.await
211
211
+
.map_err(|e| {
212
212
+
tonic::Status::unknown(
213
213
+
format!("Service was not ready: {}", e.into()),
214
214
+
)
215
215
+
})?;
193
216
let codec = tonic::codec::ProstCodec::default();
194
217
let path = http::uri::PathAndQuery::from_static(
195
218
"/tunein.v1alpha1.BrowseService/GetStationDetails",
196
219
);
197
220
let mut req = request.into_request();
198
198
-
req.extensions_mut().insert(GrpcMethod::new(
199
199
-
"tunein.v1alpha1.BrowseService",
200
200
-
"GetStationDetails",
201
201
-
));
221
221
+
req.extensions_mut()
222
222
+
.insert(
223
223
+
GrpcMethod::new("tunein.v1alpha1.BrowseService", "GetStationDetails"),
224
224
+
);
202
225
self.inner.unary(req, path, codec).await
203
226
}
204
227
pub async fn search(
205
228
&mut self,
206
229
request: impl tonic::IntoRequest<super::SearchRequest>,
207
230
) -> std::result::Result<tonic::Response<super::SearchResponse>, tonic::Status> {
208
208
-
self.inner.ready().await.map_err(|e| {
209
209
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
210
210
-
})?;
231
231
+
self.inner
232
232
+
.ready()
233
233
+
.await
234
234
+
.map_err(|e| {
235
235
+
tonic::Status::unknown(
236
236
+
format!("Service was not ready: {}", e.into()),
237
237
+
)
238
238
+
})?;
211
239
let codec = tonic::codec::ProstCodec::default();
212
212
-
let path =
213
213
-
http::uri::PathAndQuery::from_static("/tunein.v1alpha1.BrowseService/Search");
240
240
+
let path = http::uri::PathAndQuery::from_static(
241
241
+
"/tunein.v1alpha1.BrowseService/Search",
242
242
+
);
214
243
let mut req = request.into_request();
215
244
req.extensions_mut()
216
245
.insert(GrpcMethod::new("tunein.v1alpha1.BrowseService", "Search"));
···
225
254
dead_code,
226
255
missing_docs,
227
256
clippy::wildcard_imports,
228
228
-
clippy::let_unit_value
257
257
+
clippy::let_unit_value,
229
258
)]
230
259
use tonic::codegen::*;
231
260
/// Generated trait containing gRPC methods that should be implemented for use with BrowseServiceServer.
···
234
263
async fn get_categories(
235
264
&self,
236
265
request: tonic::Request<super::GetCategoriesRequest>,
237
237
-
) -> std::result::Result<tonic::Response<super::GetCategoriesResponse>, tonic::Status>;
266
266
+
) -> std::result::Result<
267
267
+
tonic::Response<super::GetCategoriesResponse>,
268
268
+
tonic::Status,
269
269
+
>;
238
270
async fn browse_category(
239
271
&self,
240
272
request: tonic::Request<super::BrowseCategoryRequest>,
241
241
-
) -> std::result::Result<tonic::Response<super::BrowseCategoryResponse>, tonic::Status>;
273
273
+
) -> std::result::Result<
274
274
+
tonic::Response<super::BrowseCategoryResponse>,
275
275
+
tonic::Status,
276
276
+
>;
242
277
async fn get_station_details(
243
278
&self,
244
279
request: tonic::Request<super::GetStationDetailsRequest>,
245
245
-
) -> std::result::Result<tonic::Response<super::GetStationDetailsResponse>, tonic::Status>;
280
280
+
) -> std::result::Result<
281
281
+
tonic::Response<super::GetStationDetailsResponse>,
282
282
+
tonic::Status,
283
283
+
>;
246
284
async fn search(
247
285
&self,
248
286
request: tonic::Request<super::SearchRequest>,
···
269
307
max_encoding_message_size: None,
270
308
}
271
309
}
272
272
-
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
310
310
+
pub fn with_interceptor<F>(
311
311
+
inner: T,
312
312
+
interceptor: F,
313
313
+
) -> InterceptedService<Self, F>
273
314
where
274
315
F: tonic::service::Interceptor,
275
316
{
···
324
365
"/tunein.v1alpha1.BrowseService/GetCategories" => {
325
366
#[allow(non_camel_case_types)]
326
367
struct GetCategoriesSvc<T: BrowseService>(pub Arc<T>);
327
327
-
impl<T: BrowseService> tonic::server::UnaryService<super::GetCategoriesRequest>
328
328
-
for GetCategoriesSvc<T>
329
329
-
{
368
368
+
impl<
369
369
+
T: BrowseService,
370
370
+
> tonic::server::UnaryService<super::GetCategoriesRequest>
371
371
+
for GetCategoriesSvc<T> {
330
372
type Response = super::GetCategoriesResponse;
331
331
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
373
373
+
type Future = BoxFuture<
374
374
+
tonic::Response<Self::Response>,
375
375
+
tonic::Status,
376
376
+
>;
332
377
fn call(
333
378
&mut self,
334
379
request: tonic::Request<super::GetCategoriesRequest>,
···
365
410
"/tunein.v1alpha1.BrowseService/BrowseCategory" => {
366
411
#[allow(non_camel_case_types)]
367
412
struct BrowseCategorySvc<T: BrowseService>(pub Arc<T>);
368
368
-
impl<T: BrowseService> tonic::server::UnaryService<super::BrowseCategoryRequest>
369
369
-
for BrowseCategorySvc<T>
370
370
-
{
413
413
+
impl<
414
414
+
T: BrowseService,
415
415
+
> tonic::server::UnaryService<super::BrowseCategoryRequest>
416
416
+
for BrowseCategorySvc<T> {
371
417
type Response = super::BrowseCategoryResponse;
372
372
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
418
418
+
type Future = BoxFuture<
419
419
+
tonic::Response<Self::Response>,
420
420
+
tonic::Status,
421
421
+
>;
373
422
fn call(
374
423
&mut self,
375
424
request: tonic::Request<super::BrowseCategoryRequest>,
···
406
455
"/tunein.v1alpha1.BrowseService/GetStationDetails" => {
407
456
#[allow(non_camel_case_types)]
408
457
struct GetStationDetailsSvc<T: BrowseService>(pub Arc<T>);
409
409
-
impl<T: BrowseService>
410
410
-
tonic::server::UnaryService<super::GetStationDetailsRequest>
411
411
-
for GetStationDetailsSvc<T>
412
412
-
{
458
458
+
impl<
459
459
+
T: BrowseService,
460
460
+
> tonic::server::UnaryService<super::GetStationDetailsRequest>
461
461
+
for GetStationDetailsSvc<T> {
413
462
type Response = super::GetStationDetailsResponse;
414
414
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
463
463
+
type Future = BoxFuture<
464
464
+
tonic::Response<Self::Response>,
465
465
+
tonic::Status,
466
466
+
>;
415
467
fn call(
416
468
&mut self,
417
469
request: tonic::Request<super::GetStationDetailsRequest>,
418
470
) -> Self::Future {
419
471
let inner = Arc::clone(&self.0);
420
472
let fut = async move {
421
421
-
<T as BrowseService>::get_station_details(&inner, request).await
473
473
+
<T as BrowseService>::get_station_details(&inner, request)
474
474
+
.await
422
475
};
423
476
Box::pin(fut)
424
477
}
···
448
501
"/tunein.v1alpha1.BrowseService/Search" => {
449
502
#[allow(non_camel_case_types)]
450
503
struct SearchSvc<T: BrowseService>(pub Arc<T>);
451
451
-
impl<T: BrowseService> tonic::server::UnaryService<super::SearchRequest> for SearchSvc<T> {
504
504
+
impl<
505
505
+
T: BrowseService,
506
506
+
> tonic::server::UnaryService<super::SearchRequest>
507
507
+
for SearchSvc<T> {
452
508
type Response = super::SearchResponse;
453
453
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
509
509
+
type Future = BoxFuture<
510
510
+
tonic::Response<Self::Response>,
511
511
+
tonic::Status,
512
512
+
>;
454
513
fn call(
455
514
&mut self,
456
515
request: tonic::Request<super::SearchRequest>,
457
516
) -> Self::Future {
458
517
let inner = Arc::clone(&self.0);
459
459
-
let fut =
460
460
-
async move { <T as BrowseService>::search(&inner, request).await };
518
518
+
let fut = async move {
519
519
+
<T as BrowseService>::search(&inner, request).await
520
520
+
};
461
521
Box::pin(fut)
462
522
}
463
523
}
···
483
543
};
484
544
Box::pin(fut)
485
545
}
486
486
-
_ => Box::pin(async move {
487
487
-
let mut response = http::Response::new(empty_body());
488
488
-
let headers = response.headers_mut();
489
489
-
headers.insert(
490
490
-
tonic::Status::GRPC_STATUS,
491
491
-
(tonic::Code::Unimplemented as i32).into(),
492
492
-
);
493
493
-
headers.insert(
494
494
-
http::header::CONTENT_TYPE,
495
495
-
tonic::metadata::GRPC_CONTENT_TYPE,
496
496
-
);
497
497
-
Ok(response)
498
498
-
}),
546
546
+
_ => {
547
547
+
Box::pin(async move {
548
548
+
let mut response = http::Response::new(empty_body());
549
549
+
let headers = response.headers_mut();
550
550
+
headers
551
551
+
.insert(
552
552
+
tonic::Status::GRPC_STATUS,
553
553
+
(tonic::Code::Unimplemented as i32).into(),
554
554
+
);
555
555
+
headers
556
556
+
.insert(
557
557
+
http::header::CONTENT_TYPE,
558
558
+
tonic::metadata::GRPC_CONTENT_TYPE,
559
559
+
);
560
560
+
Ok(response)
561
561
+
})
562
562
+
}
499
563
}
500
564
}
501
565
}
···
541
605
dead_code,
542
606
missing_docs,
543
607
clippy::wildcard_imports,
544
544
-
clippy::let_unit_value
608
608
+
clippy::let_unit_value,
545
609
)]
546
546
-
use tonic::codegen::http::Uri;
547
610
use tonic::codegen::*;
611
611
+
use tonic::codegen::http::Uri;
548
612
#[derive(Debug, Clone)]
549
613
pub struct PlaybackServiceClient<T> {
550
614
inner: tonic::client::Grpc<T>,
···
588
652
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
589
653
>,
590
654
>,
591
591
-
<T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
592
592
-
Into<StdError> + std::marker::Send + std::marker::Sync,
655
655
+
<T as tonic::codegen::Service<
656
656
+
http::Request<tonic::body::BoxBody>,
657
657
+
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
593
658
{
594
659
PlaybackServiceClient::new(InterceptedService::new(inner, interceptor))
595
660
}
···
628
693
&mut self,
629
694
request: impl tonic::IntoRequest<super::PlayRequest>,
630
695
) -> std::result::Result<tonic::Response<super::PlayResponse>, tonic::Status> {
631
631
-
self.inner.ready().await.map_err(|e| {
632
632
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
633
633
-
})?;
696
696
+
self.inner
697
697
+
.ready()
698
698
+
.await
699
699
+
.map_err(|e| {
700
700
+
tonic::Status::unknown(
701
701
+
format!("Service was not ready: {}", e.into()),
702
702
+
)
703
703
+
})?;
634
704
let codec = tonic::codec::ProstCodec::default();
635
635
-
let path =
636
636
-
http::uri::PathAndQuery::from_static("/tunein.v1alpha1.PlaybackService/Play");
705
705
+
let path = http::uri::PathAndQuery::from_static(
706
706
+
"/tunein.v1alpha1.PlaybackService/Play",
707
707
+
);
637
708
let mut req = request.into_request();
638
709
req.extensions_mut()
639
710
.insert(GrpcMethod::new("tunein.v1alpha1.PlaybackService", "Play"));
···
643
714
&mut self,
644
715
request: impl tonic::IntoRequest<super::StopRequest>,
645
716
) -> std::result::Result<tonic::Response<super::StopResponse>, tonic::Status> {
646
646
-
self.inner.ready().await.map_err(|e| {
647
647
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
648
648
-
})?;
717
717
+
self.inner
718
718
+
.ready()
719
719
+
.await
720
720
+
.map_err(|e| {
721
721
+
tonic::Status::unknown(
722
722
+
format!("Service was not ready: {}", e.into()),
723
723
+
)
724
724
+
})?;
649
725
let codec = tonic::codec::ProstCodec::default();
650
650
-
let path =
651
651
-
http::uri::PathAndQuery::from_static("/tunein.v1alpha1.PlaybackService/Stop");
726
726
+
let path = http::uri::PathAndQuery::from_static(
727
727
+
"/tunein.v1alpha1.PlaybackService/Stop",
728
728
+
);
652
729
let mut req = request.into_request();
653
730
req.extensions_mut()
654
731
.insert(GrpcMethod::new("tunein.v1alpha1.PlaybackService", "Stop"));
···
657
734
pub async fn play_or_pause(
658
735
&mut self,
659
736
request: impl tonic::IntoRequest<super::PlayOrPauseRequest>,
660
660
-
) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>
661
661
-
{
662
662
-
self.inner.ready().await.map_err(|e| {
663
663
-
tonic::Status::unknown(format!("Service was not ready: {}", e.into()))
664
664
-
})?;
737
737
+
) -> std::result::Result<
738
738
+
tonic::Response<super::PlayOrPauseResponse>,
739
739
+
tonic::Status,
740
740
+
> {
741
741
+
self.inner
742
742
+
.ready()
743
743
+
.await
744
744
+
.map_err(|e| {
745
745
+
tonic::Status::unknown(
746
746
+
format!("Service was not ready: {}", e.into()),
747
747
+
)
748
748
+
})?;
665
749
let codec = tonic::codec::ProstCodec::default();
666
750
let path = http::uri::PathAndQuery::from_static(
667
751
"/tunein.v1alpha1.PlaybackService/PlayOrPause",
668
752
);
669
753
let mut req = request.into_request();
670
670
-
req.extensions_mut().insert(GrpcMethod::new(
671
671
-
"tunein.v1alpha1.PlaybackService",
672
672
-
"PlayOrPause",
673
673
-
));
754
754
+
req.extensions_mut()
755
755
+
.insert(
756
756
+
GrpcMethod::new("tunein.v1alpha1.PlaybackService", "PlayOrPause"),
757
757
+
);
674
758
self.inner.unary(req, path, codec).await
675
759
}
676
760
}
···
682
766
dead_code,
683
767
missing_docs,
684
768
clippy::wildcard_imports,
685
685
-
clippy::let_unit_value
769
769
+
clippy::let_unit_value,
686
770
)]
687
771
use tonic::codegen::*;
688
772
/// Generated trait containing gRPC methods that should be implemented for use with PlaybackServiceServer.
···
699
783
async fn play_or_pause(
700
784
&self,
701
785
request: tonic::Request<super::PlayOrPauseRequest>,
702
702
-
) -> std::result::Result<tonic::Response<super::PlayOrPauseResponse>, tonic::Status>;
786
786
+
) -> std::result::Result<
787
787
+
tonic::Response<super::PlayOrPauseResponse>,
788
788
+
tonic::Status,
789
789
+
>;
703
790
}
704
791
#[derive(Debug)]
705
792
pub struct PlaybackServiceServer<T> {
···
722
809
max_encoding_message_size: None,
723
810
}
724
811
}
725
725
-
pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
812
812
+
pub fn with_interceptor<F>(
813
813
+
inner: T,
814
814
+
interceptor: F,
815
815
+
) -> InterceptedService<Self, F>
726
816
where
727
817
F: tonic::service::Interceptor,
728
818
{
···
777
867
"/tunein.v1alpha1.PlaybackService/Play" => {
778
868
#[allow(non_camel_case_types)]
779
869
struct PlaySvc<T: PlaybackService>(pub Arc<T>);
780
780
-
impl<T: PlaybackService> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> {
870
870
+
impl<
871
871
+
T: PlaybackService,
872
872
+
> tonic::server::UnaryService<super::PlayRequest> for PlaySvc<T> {
781
873
type Response = super::PlayResponse;
782
782
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
874
874
+
type Future = BoxFuture<
875
875
+
tonic::Response<Self::Response>,
876
876
+
tonic::Status,
877
877
+
>;
783
878
fn call(
784
879
&mut self,
785
880
request: tonic::Request<super::PlayRequest>,
786
881
) -> Self::Future {
787
882
let inner = Arc::clone(&self.0);
788
788
-
let fut =
789
789
-
async move { <T as PlaybackService>::play(&inner, request).await };
883
883
+
let fut = async move {
884
884
+
<T as PlaybackService>::play(&inner, request).await
885
885
+
};
790
886
Box::pin(fut)
791
887
}
792
888
}
···
815
911
"/tunein.v1alpha1.PlaybackService/Stop" => {
816
912
#[allow(non_camel_case_types)]
817
913
struct StopSvc<T: PlaybackService>(pub Arc<T>);
818
818
-
impl<T: PlaybackService> tonic::server::UnaryService<super::StopRequest> for StopSvc<T> {
914
914
+
impl<
915
915
+
T: PlaybackService,
916
916
+
> tonic::server::UnaryService<super::StopRequest> for StopSvc<T> {
819
917
type Response = super::StopResponse;
820
820
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
918
918
+
type Future = BoxFuture<
919
919
+
tonic::Response<Self::Response>,
920
920
+
tonic::Status,
921
921
+
>;
821
922
fn call(
822
923
&mut self,
823
924
request: tonic::Request<super::StopRequest>,
824
925
) -> Self::Future {
825
926
let inner = Arc::clone(&self.0);
826
826
-
let fut =
827
827
-
async move { <T as PlaybackService>::stop(&inner, request).await };
927
927
+
let fut = async move {
928
928
+
<T as PlaybackService>::stop(&inner, request).await
929
929
+
};
828
930
Box::pin(fut)
829
931
}
830
932
}
···
853
955
"/tunein.v1alpha1.PlaybackService/PlayOrPause" => {
854
956
#[allow(non_camel_case_types)]
855
957
struct PlayOrPauseSvc<T: PlaybackService>(pub Arc<T>);
856
856
-
impl<T: PlaybackService> tonic::server::UnaryService<super::PlayOrPauseRequest>
857
857
-
for PlayOrPauseSvc<T>
858
858
-
{
958
958
+
impl<
959
959
+
T: PlaybackService,
960
960
+
> tonic::server::UnaryService<super::PlayOrPauseRequest>
961
961
+
for PlayOrPauseSvc<T> {
859
962
type Response = super::PlayOrPauseResponse;
860
860
-
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
963
963
+
type Future = BoxFuture<
964
964
+
tonic::Response<Self::Response>,
965
965
+
tonic::Status,
966
966
+
>;
861
967
fn call(
862
968
&mut self,
863
969
request: tonic::Request<super::PlayOrPauseRequest>,
···
891
997
};
892
998
Box::pin(fut)
893
999
}
894
894
-
_ => Box::pin(async move {
895
895
-
let mut response = http::Response::new(empty_body());
896
896
-
let headers = response.headers_mut();
897
897
-
headers.insert(
898
898
-
tonic::Status::GRPC_STATUS,
899
899
-
(tonic::Code::Unimplemented as i32).into(),
900
900
-
);
901
901
-
headers.insert(
902
902
-
http::header::CONTENT_TYPE,
903
903
-
tonic::metadata::GRPC_CONTENT_TYPE,
904
904
-
);
905
905
-
Ok(response)
906
906
-
}),
1000
1000
+
_ => {
1001
1001
+
Box::pin(async move {
1002
1002
+
let mut response = http::Response::new(empty_body());
1003
1003
+
let headers = response.headers_mut();
1004
1004
+
headers
1005
1005
+
.insert(
1006
1006
+
tonic::Status::GRPC_STATUS,
1007
1007
+
(tonic::Code::Unimplemented as i32).into(),
1008
1008
+
);
1009
1009
+
headers
1010
1010
+
.insert(
1011
1011
+
http::header::CONTENT_TYPE,
1012
1012
+
tonic::metadata::GRPC_CONTENT_TYPE,
1013
1013
+
);
1014
1014
+
Ok(response)
1015
1015
+
})
1016
1016
+
}
907
1017
}
908
1018
}
909
1019
}