Fix null host - #1369
Fix null host#1369Marco-Farruggio wants to merge 12 commits into
Conversation
|
Also, |
LastExceed
left a comment
There was a problem hiding this comment.
Quick glance, static only. Although I have a strong suspicion that this is all getting deleted anyway 😁
| #[cfg(feature = "custom")] | ||
| pub fn default_host() -> Host { | ||
| CustomHost::new() | ||
| .expect("the default host should always be available") | ||
| .into() | ||
| } |
There was a problem hiding this comment.
defaulting to custom host seems counter intuitive to me
There was a problem hiding this comment.
this is only because no other hosts exist there, so its either custom or a panic
There was a problem hiding this comment.
Hmm ok if it returned a result I would actually be inclined to an error, but panic is no-go of course
| Error::with_message(DeviceNotAvailable, "Null host in use") | ||
| } | ||
|
|
||
| fn pause(&self) -> Result<(), Error> { | ||
| unimplemented!() | ||
| Error::with_message(DeviceNotAvailable, "Null host in use") | ||
| } | ||
|
|
||
| fn stop(&self, _timeout: Option<std::time::Duration>) -> Result<(), Error> { | ||
| unimplemented!() | ||
| Error::with_message(DeviceNotAvailable, "Null host in use") | ||
| } | ||
|
|
||
| fn now(&self) -> StreamInstant { | ||
| unimplemented!() | ||
| StreamInstant::ZERO | ||
| } | ||
|
|
||
| fn buffer_size(&self) -> Result<FrameCount, Error> { | ||
| unimplemented!() | ||
| Error::with_message(DeviceNotAvailable, "Null host in use") |
There was a problem hiding this comment.
How about adding a private field to Device and Stream so it is impossible to get an instance of them? then the functions could be left unimplemented
|
If you mean the PR or the null host, either way they will probably both get deleted 😆 |
Not sure if we will delete null host for now, but until then this patches up some things :)