#![allow(clippy::ref_option, reason = "for the getset crate")]
use crate::places_new::Place;
#[derive(
// std
Clone,
Debug,
// serde
serde::Deserialize,
serde::Serialize,
// getset
getset::Getters,
getset::MutGetters,
getset::Setters,
)]
#[serde(rename_all = "camelCase")]
pub struct Response(Place);
impl Response {
#[must_use]
pub const fn new(place: Place) -> Self {
Self(place)
}
}
impl std::ops::Deref for Response {
type Target = Place;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Response {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl AsRef<Place> for Response {
fn as_ref(&self) -> &Place {
&self.0
}
}
impl AsMut<Place> for Response {
fn as_mut(&mut self) -> &mut Place {
&mut self.0
}
}
impl std::convert::From<Response> for Result<Response, crate::Error> {
fn from(response: Response) -> Self {
Ok(response)
}
}