(hiddenCloseable: StringAdd).self
(hiddenCloseable: StringFormat).self
(hiddenCloseable: ArrowAssoc[HiddenCloseable]).x
(Since version 2.10.0) Use leftOfArrow instead
(hiddenCloseable: Ensuring[HiddenCloseable]).x
(Since version 2.10.0) Use resultOfEnsuring instead
Utility mixin that moves the
close()functionality to thereallyClosemethod, and overridesclose()itself to no-op.Used for resources that take stream/reader instances directly, to enforce the policy of "whoever creates the stream is responsible for closing it".
Unfortunately, simply implementing an
XMLResource[T]to have a no-opclosemethod is not sufficient, since the javax XMLEventReader will try to close the underlying stream when it reaches the end. By mixing this trait into a proxy stream and using that to construct the XMLEventReader, we can guarantee that the underlying stream will only be closed by whoever constructed the underlying stream.