Skip to content

Commit 21263b5

Browse files
committed
response: Add parse method to Response
1 parent 21150d1 commit 21263b5

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@ All changes in this project will be noted in this file.
44

55
### 0.8.7 (unreleased)
66

7-
> **BREAKING PATCH DUE TO MINIMUM VERSION UPGRADE**
8-
> - **Minimum Supported Skytable Version**: 0.8.2
97
> - **Field change warnings**:
108
> - The `Config` struct now has one additional field. This is not a breaking change because the functionality of the library remains unchanged
9+
10+
#### Additions
11+
1112
- Added support for pipelines
13+
- Added `Response::parse` to convert a response into compatible types
1214

1315
### 0.8.6
1416

src/response.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@ pub enum Response {
133133
Error(u16),
134134
}
135135

136+
impl Response {
137+
/// Attempt to convert the response into the given type
138+
pub fn parse<T: FromResponse>(self) -> ClientResult<T> {
139+
T::from_response(self)
140+
}
141+
}
142+
136143
/*
137144
Response traits
138145
*/

0 commit comments

Comments
 (0)