pub struct Cassette {
pub interactions: Vec<Interaction>,
pub path: Option<PathBuf>,
pub modified_since_load: bool,
pub format: CassetteFormat,
}Fields§
§interactions: Vec<Interaction>§path: Option<PathBuf>§modified_since_load: bool§format: CassetteFormatImplementations§
Source§impl Cassette
impl Cassette
pub fn new() -> Self
pub fn with_path(self, path: PathBuf) -> Self
Sourcepub fn with_format(self, format: CassetteFormat) -> Self
pub fn with_format(self, format: CassetteFormat) -> Self
Explicitly set the cassette format (useful when creating new cassettes)
pub async fn load_from_file(path: PathBuf) -> Result<Self, Error>
pub async fn save_to_file(&self) -> Result<(), Error>
pub fn clear(&mut self)
pub async fn record_interaction( &mut self, serializable_request: SerializableRequest, serializable_response: SerializableResponse, ) -> Result<(), Error>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Cassette
impl<'de> Deserialize<'de> for Cassette
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Cassette
impl RefUnwindSafe for Cassette
impl Send for Cassette
impl Sync for Cassette
impl Unpin for Cassette
impl UnwindSafe for Cassette
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