pub struct Fixture { /* private fields */ }Expand description
A device as recorded in a fixture directory:
tr64desc.xml
scpd/<file>.xml
responses/<service>/<action>[@<index>].json
lists/<name>.<xml|json>
api/<path>.jsonA list document lists/devicehostlist.xml is served at the path
/devicehostlist.lua that an action like X_AVM-DE_GetHostListPath
returns. A document api/v0/smarthome/overview.json of the REST API is
served at /api/v0/smarthome/overview.
Implementations§
Source§impl Fixture
impl Fixture
Sourcepub fn bundled(name: &str) -> Result<Self, Error>
pub fn bundled(name: &str) -> Result<Self, Error>
Loads a fixture that comes with this crate, by name like
fritzbox-7690/8.25. The fixtures are part of the crate, so this
reads no files. See Fixture::bundled_names.
§Errors
Error::Unknown if no fixture has the name.
Sourcepub fn bundled_names() -> Vec<String>
pub fn bundled_names() -> Vec<String>
The names of the fixtures that come with this crate, sorted, like
fritzbox-7690/8.25. Tests can run against each of them.
Sourcepub fn load(dir: impl AsRef<Path>) -> Result<Self, Error>
pub fn load(dir: impl AsRef<Path>) -> Result<Self, Error>
Loads the fixture in dir.
§Errors
The errors of reading the files, and Error::Invalid if one of
them cannot be parsed.
Sourcepub fn description(&self) -> &DeviceDescription
pub fn description(&self) -> &DeviceDescription
The device description.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Fixture
impl Freeze for Fixture
impl Move for Fixture
impl RefUnwindSafe for Fixture
impl Send for Fixture
impl Sync for Fixture
impl Unpin for Fixture
impl UnsafeUnpin for Fixture
impl UnwindSafe for Fixture
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