Struct mpd_protocol::response::Response
source · pub struct Response { /* private fields */ }
Expand description
Implementations§
source§impl Response
impl Response
sourcepub fn is_error(&self) -> bool
pub fn is_error(&self) -> bool
Returns true
if the response contains an error.
Even if this returns true
, there may still be successful frames in the response when the
response is to a command list.
sourcepub fn is_success(&self) -> bool
pub fn is_success(&self) -> bool
Returns true
if the response was entirely successful (i.e. no errors).
sourcepub fn successful_frames(&self) -> usize
pub fn successful_frames(&self) -> usize
Get the number of successful frames in the response.
May be 0 if the response only consists of an error.
sourcepub fn frames(&self) -> FramesRef<'_> ⓘ
pub fn frames(&self) -> FramesRef<'_> ⓘ
Create an iterator over references to the frames in the response.
This yields Result
s, with successful frames becoming Ok()
s and an error becoming a
(final) Err()
.
sourcepub fn into_single_frame(self) -> Result<Frame, Error>
pub fn into_single_frame(self) -> Result<Frame, Error>
Extract the first frame or error from the response.
Any additional frames are discarded. This is useful for responses to single commands.
Trait Implementations§
source§impl<'a> IntoIterator for &'a Response
impl<'a> IntoIterator for &'a Response
source§impl IntoIterator for Response
impl IntoIterator for Response
source§impl PartialEq for Response
impl PartialEq for Response
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnwindSafe for Response
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more