#[repr(C)]pub enum Response {
Sd(Response),
Sdio(Response),
Spi(Response),
}
Expand description
Represents the top-level SD/MMC response types.
§Example
use sdmmc_core::response::{sd, Response, ResponseMode, ResponseType};
let r1 = sd::r1::R1::new();
let sd_r1 = sd::Response::from(r1);
let res = Response::from(sd_r1);
assert_eq!(sd_r1, sd::Response::R1(r1));
assert_eq!(res, Response::Sd(sd_r1));
assert_eq!(sd_r1.into_r1(), Ok(r1));
assert_eq!(res.into_sd(), Ok(sd_r1));
assert_eq!(r1.response_type(), ResponseType::R1);
assert_eq!(r1.response_mode(), ResponseMode::Sd);
assert_eq!(r1.response_type(), sd_r1.response_type());
assert_eq!(r1.response_mode(), sd_r1.response_mode());
assert_eq!(r1.response_type(), res.response_type());
assert_eq!(r1.response_mode(), res.response_mode());
Variants§
Implementations§
Source§impl Response
impl Response
Sourcepub const fn response_type(&self) -> ResponseType
pub const fn response_type(&self) -> ResponseType
Gets the response type for the Response.
Sourcepub const fn response_mode(&self) -> ResponseMode
pub const fn response_mode(&self) -> ResponseMode
Gets the response mode for the Response.
Trait Implementations§
impl Copy for Response
impl Eq for Response
impl StructuralPartialEq for Response
Auto Trait Implementations§
impl Freeze for Response
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