pub struct RuntimeEnvironment { /* private fields */ }Expand description
Interprets exact requests, fixture bytes, atomic files, and runtime observations.
Implementations§
Source§impl RuntimeEnvironment
impl RuntimeEnvironment
Sourcepub fn build() -> Result<Self, Error>
pub fn build() -> Result<Self, Error>
Constructs the production environment and its HTTP client.
§Errors
Returns failure to construct the Rustls-backed client.
Sourcepub fn build_observed(observer: RuntimeObservationSender) -> Result<Self, Error>
pub fn build_observed(observer: RuntimeObservationSender) -> Result<Self, Error>
Constructs the production environment with a live observation channel.
§Errors
Returns failure to construct the Rustls-backed client.
Sourcepub fn build_pausable(
observer: RuntimeObservationSender,
pause: RuntimePause,
) -> Result<Self, Error>
pub fn build_pausable( observer: RuntimeObservationSender, pause: RuntimePause, ) -> Result<Self, Error>
Constructs the production environment with observation and cooperative pause control.
§Errors
Returns failure to construct the Rustls-backed client.
Sourcepub fn events(&self) -> Vec<DownloadEvent>
pub fn events(&self) -> Vec<DownloadEvent>
Observes terminal download events in emission order.
Sourcepub fn progress(&self) -> Vec<DownloadProgress>
pub fn progress(&self) -> Vec<DownloadProgress>
Observes byte-progress reports in emission order.
Trait Implementations§
Source§impl AtomicPublishAlg for RuntimeEnvironment
impl AtomicPublishAlg for RuntimeEnvironment
Source§type Publication = RuntimePublication
type Publication = RuntimePublication
Source§fn begin_publication(
&self,
destination: &Path,
) -> Result<Self::Publication, Self::Error>
fn begin_publication( &self, destination: &Path, ) -> Result<Self::Publication, Self::Error>
Source§fn write_publication(
&self,
publication: &mut Self::Publication,
bytes: &[u8],
) -> Result<(), Self::Error>
fn write_publication( &self, publication: &mut Self::Publication, bytes: &[u8], ) -> Result<(), Self::Error>
Source§fn commit_publication(
&self,
publication: Self::Publication,
) -> Result<(), Self::Error>
fn commit_publication( &self, publication: Self::Publication, ) -> Result<(), Self::Error>
Source§fn abort_publication(&self, publication: Self::Publication)
fn abort_publication(&self, publication: Self::Publication)
Source§impl Debug for RuntimeEnvironment
impl Debug for RuntimeEnvironment
Source§impl DownloadObservationAlg for RuntimeEnvironment
impl DownloadObservationAlg for RuntimeEnvironment
Source§type Event = DownloadEvent
type Event = DownloadEvent
Source§type Progress = DownloadProgress
type Progress = DownloadProgress
Source§fn download_progress(
&self,
destination: &Path,
downloaded: u64,
total: Option<u64>,
) -> Self::Progress
fn download_progress( &self, destination: &Path, downloaded: u64, total: Option<u64>, ) -> Self::Progress
Source§impl DownloadProgressAlg for RuntimeEnvironment
impl DownloadProgressAlg for RuntimeEnvironment
Source§type Progress = DownloadProgress
type Progress = DownloadProgress
Source§fn report_progress(&self, progress: DownloadProgress)
fn report_progress(&self, progress: DownloadProgress)
Source§impl DownloadReportAlg for RuntimeEnvironment
impl DownloadReportAlg for RuntimeEnvironment
Source§type Event = DownloadEvent
type Event = DownloadEvent
Source§fn report_download(&self, event: DownloadEvent)
fn report_download(&self, event: DownloadEvent)
Source§impl ExtractionAlg for RuntimeEnvironment
impl ExtractionAlg for RuntimeEnvironment
Source§fn media(
&self,
id: impl Into<String>,
metadata: Self::Metadata,
formats: impl IntoIterator<Item = Self::Format>,
) -> Self::Extraction
fn media( &self, id: impl Into<String>, metadata: Self::Metadata, formats: impl IntoIterator<Item = Self::Format>, ) -> Self::Extraction
Source§fn url_reference(
&self,
url: impl Into<String>,
extractor: Option<Self::Extractor>,
transparent: bool,
) -> Self::Extraction
fn url_reference( &self, url: impl Into<String>, extractor: Option<Self::Extractor>, transparent: bool, ) -> Self::Extraction
Source§fn extraction_collection(
&self,
id: Option<String>,
kind: CollectionKind,
metadata: Self::Metadata,
entries: impl IntoIterator<Item = Self::Extraction>,
) -> Self::Extraction
fn extraction_collection( &self, id: Option<String>, kind: CollectionKind, metadata: Self::Metadata, entries: impl IntoIterator<Item = Self::Extraction>, ) -> Self::Extraction
Source§impl ExtractionApplyAlg for RuntimeEnvironment
impl ExtractionApplyAlg for RuntimeEnvironment
Source§type Error = RuntimeExtractionError
type Error = RuntimeExtractionError
Source§fn extract_with(
&self,
extractor: &ExtractorKey,
url: &str,
) -> Result<Extraction, Self::Error>
fn extract_with( &self, extractor: &ExtractorKey, url: &str, ) -> Result<Extraction, Self::Error>
Source§impl ExtractionCatalogAlg for RuntimeEnvironment
impl ExtractionCatalogAlg for RuntimeEnvironment
Source§fn extractor_keys(&self) -> impl Iterator<Item = &ExtractorKey>
fn extractor_keys(&self) -> impl Iterator<Item = &ExtractorKey>
Source§fn extractor_accepts(&self, extractor: &ExtractorKey, url: &str) -> bool
fn extractor_accepts(&self, extractor: &ExtractorKey, url: &str) -> bool
Source§impl FetchStreamAlg for RuntimeEnvironment
impl FetchStreamAlg for RuntimeEnvironment
Source§type Error = RuntimeFetchError
type Error = RuntimeFetchError
Source§type Stream = RuntimeFetchStream
type Stream = RuntimeFetchStream
Source§fn open_fetch(
&self,
url: &str,
) -> Result<FetchStream<Self::Stream>, Self::Error>
fn open_fetch( &self, url: &str, ) -> Result<FetchStream<Self::Stream>, Self::Error>
Source§impl FetchStreamAlg<String> for RuntimeEnvironment
impl FetchStreamAlg<String> for RuntimeEnvironment
Source§type Error = RuntimeFetchError
type Error = RuntimeFetchError
Source§type Stream = RuntimeFetchStream
type Stream = RuntimeFetchStream
Source§fn open_fetch(
&self,
url: &String,
) -> Result<FetchStream<Self::Stream>, Self::Error>
fn open_fetch( &self, url: &String, ) -> Result<FetchStream<Self::Stream>, Self::Error>
Source§impl FetchStreamAlg<YoutubeRequest> for RuntimeEnvironment
impl FetchStreamAlg<YoutubeRequest> for RuntimeEnvironment
Source§type Error = RuntimeFetchError
type Error = RuntimeFetchError
Source§type Stream = RuntimeFetchStream
type Stream = RuntimeFetchStream
Source§fn open_fetch(
&self,
request: &YoutubeRequest,
) -> Result<FetchStream<Self::Stream>, Self::Error>
fn open_fetch( &self, request: &YoutubeRequest, ) -> Result<FetchStream<Self::Stream>, Self::Error>
Source§impl FormatAlg for RuntimeEnvironment
impl FormatAlg for RuntimeEnvironment
Source§impl FormatPredicateMatchAlg for RuntimeEnvironment
impl FormatPredicateMatchAlg for RuntimeEnvironment
Source§fn format_matches(&self, predicate: &FormatPredicate, format: &Format) -> bool
fn format_matches(&self, predicate: &FormatPredicate, format: &Format) -> bool
Source§impl FormatSelectionApplyAlg for RuntimeEnvironment
impl FormatSelectionApplyAlg for RuntimeEnvironment
Source§fn select_formats<'a>(
&self,
formats: &'a [Format],
selection: &FormatSelection,
) -> Option<Vec<&'a Format>>
fn select_formats<'a>( &self, formats: &'a [Format], selection: &FormatSelection, ) -> Option<Vec<&'a Format>>
Source§impl FormatSourceAlg<String> for RuntimeEnvironment
impl FormatSourceAlg<String> for RuntimeEnvironment
Source§impl FormatSourceAlg<YoutubeRequest> for RuntimeEnvironment
impl FormatSourceAlg<YoutubeRequest> for RuntimeEnvironment
Source§fn format_source(&self, format: &Format) -> Option<YoutubeRequest>
fn format_source(&self, format: &Format) -> Option<YoutubeRequest>
Source§impl FormatViewAlg for RuntimeEnvironment
impl FormatViewAlg for RuntimeEnvironment
Source§impl MediaSorts for RuntimeEnvironment
impl MediaSorts for RuntimeEnvironment
Source§type Metadata = InfoRecord
type Metadata = InfoRecord
Source§type Extraction = Extraction
type Extraction = Extraction
Source§type Extractor = ExtractorKey
type Extractor = ExtractorKey
Source§type Predicate = FormatPredicate
type Predicate = FormatPredicate
Source§type Selection = FormatSelection
type Selection = FormatSelection
Source§impl MediaViewAlg for RuntimeEnvironment
impl MediaViewAlg for RuntimeEnvironment
Source§impl MetadataAlg for RuntimeEnvironment
impl MetadataAlg for RuntimeEnvironment
Source§fn empty_metadata(&self) -> Self::Metadata
fn empty_metadata(&self) -> Self::Metadata
Source§fn null_metadata(&self) -> Self::Value
fn null_metadata(&self) -> Self::Value
Source§fn boolean_metadata(&self, value: bool) -> Self::Value
fn boolean_metadata(&self, value: bool) -> Self::Value
Source§fn integer_metadata(&self, value: i64) -> Self::Value
fn integer_metadata(&self, value: i64) -> Self::Value
Source§fn float_metadata(&self, value: f64) -> Self::Value
fn float_metadata(&self, value: f64) -> Self::Value
Source§fn list_metadata(
&self,
values: impl IntoIterator<Item = Self::Value>,
) -> Self::Value
fn list_metadata( &self, values: impl IntoIterator<Item = Self::Value>, ) -> Self::Value
Source§fn record_metadata(&self, record: Self::Metadata) -> Self::Value
fn record_metadata(&self, record: Self::Metadata) -> Self::Value
Source§impl XRequestAlg for RuntimeEnvironment
impl XRequestAlg for RuntimeEnvironment
Source§impl XRequestViewAlg for RuntimeEnvironment
impl XRequestViewAlg for RuntimeEnvironment
Source§fn request_address<'a>(&self, request: &'a String) -> &'a str
fn request_address<'a>(&self, request: &'a String) -> &'a str
Source§impl XSorts for RuntimeEnvironment
impl XSorts for RuntimeEnvironment
Source§impl YoutubeChallengeAlg for RuntimeEnvironment
impl YoutubeChallengeAlg for RuntimeEnvironment
Source§fn solve_challenges(
&self,
program: &str,
challenges: impl IntoIterator<Item = YoutubeChallenge>,
) -> Result<Self::Solutions, Self::Error>
fn solve_challenges( &self, program: &str, challenges: impl IntoIterator<Item = YoutubeChallenge>, ) -> Result<Self::Solutions, Self::Error>
Source§impl YoutubeClientAlg for RuntimeEnvironment
impl YoutubeClientAlg for RuntimeEnvironment
Source§fn player_clients(&self) -> impl Iterator<Item = &str>
fn player_clients(&self) -> impl Iterator<Item = &str>
Source§impl YoutubeRequestAlg for RuntimeEnvironment
impl YoutubeRequestAlg for RuntimeEnvironment
Source§fn watch_request(&self, url: impl Into<String>) -> Self::Request
fn watch_request(&self, url: impl Into<String>) -> Self::Request
Source§fn player_request(
&self,
id: impl Into<String>,
api_key: impl Into<String>,
claim: &PlayerClaim,
) -> Self::Request
fn player_request( &self, id: impl Into<String>, api_key: impl Into<String>, claim: &PlayerClaim, ) -> Self::Request
Source§impl YoutubeRequestBytesAlg for RuntimeEnvironment
impl YoutubeRequestBytesAlg for RuntimeEnvironment
Source§type Error = RuntimeFetchError
type Error = RuntimeFetchError
Source§fn youtube_request_bytes(
&self,
request: &YoutubeRequest,
) -> Result<Vec<u8>, Self::Error>
fn youtube_request_bytes( &self, request: &YoutubeRequest, ) -> Result<Vec<u8>, Self::Error>
Source§impl YoutubeResponseAlg for RuntimeEnvironment
impl YoutubeResponseAlg for RuntimeEnvironment
Source§fn decode_youtube_watch(
&self,
bytes: &[u8],
) -> Result<YoutubeWatchPage, Self::Error>
fn decode_youtube_watch( &self, bytes: &[u8], ) -> Result<YoutubeWatchPage, Self::Error>
Source§fn decode_youtube_player(
&self,
bytes: &[u8],
) -> Result<YoutubePlayer, Self::Error>
fn decode_youtube_player( &self, bytes: &[u8], ) -> Result<YoutubePlayer, Self::Error>
Source§impl YoutubeSolutionAlg for RuntimeEnvironment
impl YoutubeSolutionAlg for RuntimeEnvironment
Source§fn solution_of(
&self,
solutions: &Self::Solutions,
challenge: &YoutubeChallenge,
) -> Option<String>
fn solution_of( &self, solutions: &Self::Solutions, challenge: &YoutubeChallenge, ) -> Option<String>
Source§impl YoutubeSorts for RuntimeEnvironment
impl YoutubeSorts for RuntimeEnvironment
Source§type Request = YoutubeRequest
type Request = YoutubeRequest
Source§type Solutions = YoutubeSolutions
type Solutions = YoutubeSolutions
Source§impl YoutubeUrlAlg for RuntimeEnvironment
impl YoutubeUrlAlg for RuntimeEnvironment
Auto Trait Implementations§
impl !Freeze for RuntimeEnvironment
impl !RefUnwindSafe for RuntimeEnvironment
impl !Sync for RuntimeEnvironment
impl !UnwindSafe for RuntimeEnvironment
impl Send for RuntimeEnvironment
impl Unpin for RuntimeEnvironment
impl UnsafeUnpin for RuntimeEnvironment
Blanket Implementations§
Source§impl<This, ExtractionError, FetchError, PublishError, Event, Progress> ApplicationExt<This, ExtractionError, FetchError, PublishError, Event, Progress> for Thiswhere
This: ExtractionApplyAlg<Error = ExtractionError> + ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<String> + FetchStreamAlg<String, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event> + ExtractionCatalogAlg,
FetchError: Display,
PublishError: Display,
impl<This, ExtractionError, FetchError, PublishError, Event, Progress> ApplicationExt<This, ExtractionError, FetchError, PublishError, Event, Progress> for Thiswhere
This: ExtractionApplyAlg<Error = ExtractionError> + ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<String> + FetchStreamAlg<String, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event> + ExtractionCatalogAlg,
FetchError: Display,
PublishError: Display,
Source§fn download_url(
&self,
url: &str,
selection: &<This as MediaSorts>::Selection,
target: &OutputTarget,
) -> Result<PathBuf, ApplicationError<ExtractionError, FetchError, PublishError>>
fn download_url( &self, url: &str, selection: &<This as MediaSorts>::Selection, target: &OutputTarget, ) -> Result<PathBuf, ApplicationError<ExtractionError, FetchError, PublishError>>
Downloads one URL through exactly one selected direct format.
§Errors
Returns extraction, selection, retrieval, or publication failure.
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
Source§impl<This, Source, FetchError, PublishError, Event, Progress> DownloadExt<This, Source, FetchError, PublishError, Event, Progress> for Thiswhere
This: FetchStreamAlg<Source, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event>,
FetchError: Display,
PublishError: Display,
Source: ?Sized,
impl<This, Source, FetchError, PublishError, Event, Progress> DownloadExt<This, Source, FetchError, PublishError, Event, Progress> for Thiswhere
This: FetchStreamAlg<Source, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event>,
FetchError: Display,
PublishError: Display,
Source: ?Sized,
Source§fn download_resource(
&self,
source: &Source,
destination: &Path,
) -> Result<u64, DownloadError<FetchError, PublishError>>
fn download_resource( &self, source: &Source, destination: &Path, ) -> Result<u64, DownloadError<FetchError, PublishError>>
Fetches, atomically publishes, and reports exactly one terminal event.
§Errors
Returns the fetch or publication failure after reporting it.
Source§impl<This, Extractor, Extraction> ExtractionExt<This, Extractor, Extraction> for Thiswhere
This: ExtractionCatalogAlg<Extractor = Extractor, Extractor = Extractor, Extraction = Extraction> + ExtractionApplyAlg,
impl<This, Extractor, Extraction> ExtractionExt<This, Extractor, Extraction> for Thiswhere
This: ExtractionCatalogAlg<Extractor = Extractor, Extractor = Extractor, Extraction = Extraction> + ExtractionApplyAlg,
Source§fn choose_extractor(&self, url: &str) -> Option<&Extractor>
fn choose_extractor(&self, url: &str) -> Option<&Extractor>
Chooses the first extractor accepting the URL.
Source§fn extract_url(
&self,
url: &str,
) -> Result<Extraction, ExtractUrlError<<This as ExtractionApplyAlg>::Error>>
fn extract_url( &self, url: &str, ) -> Result<Extraction, ExtractUrlError<<This as ExtractionApplyAlg>::Error>>
Extracts a URL through the first accepting extractor.
§Errors
Returns ExtractUrlError::Unsupported when no extractor accepts the URL, or wraps the
selected extractor’s failure in ExtractUrlError::Extractor.
Source§impl<This> FormatLaws<This> for This
impl<This> FormatLaws<This> for This
Source§fn format_laws(&self) -> Result<(), Error>
fn format_laws(&self) -> Result<(), Error>
Checks that a format states back exactly what it was defined with.
The laws checked are:
- an observation a format states is the one it is observed under;
- distinct observation names are independent;
- an unstated observation is absent rather than defaulted.
§Errors
Returns the first violated law.
Source§impl<This> GaugeLaws<This> for This
impl<This> GaugeLaws<This> for This
Source§fn gauge_laws(&self) -> Result<(), Error>
fn gauge_laws(&self) -> Result<(), Error>
Checks that a gauge states a share without claiming more resolution than it has.
The laws checked are:
- a gauge occupies its stated width whatever share it states;
- no share is stated as filled before it is reached, and none is stated twice;
- nothing stated is nothing filled, and everything stated fills the whole track;
- the stated text occupies exactly one cell per counted cell.
§Errors
Returns the first violated law.
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<This> IntoExt<This> for This
impl<This> IntoExt<This> for This
Source§fn to<R>(self) -> Rwhere
This: Into<R>,
fn to<R>(self) -> Rwhere
This: Into<R>,
A version of Into::into function that can be used to explicitly specify the target
conversion type.
use alux_sdk::*;
// `Into` requires context to infer the type,
let _: i64 = Into::into(42_i8);
// The opposite `From` requires context to infer the type,
let _: i64 = From::from(42_i8);
// `.to()` can be used in the same way as a postfix function (the same as `.into()`),
let _: i64 = 42_i8.to();
// but also with the type specified explicitly.
let _ = 42_i8.to::<i64>();
// Especially useful to chain multiple conversions inline.
let _: i64 = 42_i8.to::<i16>().to::<i32>().into();Source§impl<This> IntoIteratorExt<This> for This
impl<This> IntoIteratorExt<This> for This
Source§fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
fn try_collect_vec<T, E>(self) -> Result<Vec<T>, E>
A variant of the try_collect and collect_vec combined function from the Itertools
library. The materialized value is a Vec inside a Result object.
Returns the first error without collecting later values.
use alux_sdk::*;
let values = [Ok::<_, &str>(1), Ok(2), Ok(3)]
.into_iter()
.try_collect_vec();
assert_eq!(values, Ok(vec![1, 2, 3]));Source§fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
fn collect_exact<T>(self, n: usize) -> Option<Vec<T>>where
This: Iterator<Item = T>,
Takes exactly n elements from the iterator.
Returns Some(Vec<T>) if the iterator yields exactly n elements,
otherwise returns None.
use alux_sdk::*;
let v = [1, 2, 3];
assert_eq!(v.iter().copied().collect_exact(3), Some(vec![1, 2, 3]));
assert_eq!(v.iter().copied().collect_exact(4), None);
assert_eq!(v.iter().copied().collect_exact(2), None);Source§fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
fn try_unzip<A, B, E>(self) -> Result<(Vec<A>, Vec<B>), E>
Efficiently splits an iterator of Result<(A, B), E> into two Vecs, short-circuiting on error.
Consumes the iterator, collecting all A elements into one vector and all B elements into another,
without first allocating an intermediate vector of tuples. Returns the tuple (Vec<A>, Vec<B>) on success,
or the first error encountered.
use alux_sdk::*;
let input = vec![Ok((1, "x")), Ok((2, "y"))];
let (xs, ys) = input.try_unzip::<_, _, ()>().unwrap();
assert_eq!(xs, vec![1, 2]);
assert_eq!(ys, vec!["x", "y"]);Source§impl<This, Source, FetchError, PublishError, Event, Progress> MediaDownloadExt<This, Source, FetchError, PublishError, Event, Progress> for Thiswhere
This: ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<Source> + FetchStreamAlg<Source, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event>,
FetchError: Display,
PublishError: Display,
impl<This, Source, FetchError, PublishError, Event, Progress> MediaDownloadExt<This, Source, FetchError, PublishError, Event, Progress> for Thiswhere
This: ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<Source> + FetchStreamAlg<Source, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event>,
FetchError: Display,
PublishError: Display,
Source§fn download_extraction(
&self,
extraction: <This as MediaSorts>::Extraction,
selection: &<This as MediaSorts>::Selection,
target: &OutputTarget,
) -> Result<PathBuf, MediaDownloadError<FetchError, PublishError>>
fn download_extraction( &self, extraction: <This as MediaSorts>::Extraction, selection: &<This as MediaSorts>::Selection, target: &OutputTarget, ) -> Result<PathBuf, MediaDownloadError<FetchError, PublishError>>
Downloads exactly one selected format from an extracted single-media result.
§Errors
Returns media-shape, selection, retrieval, or publication failure.
Source§impl<This> MediaOutputExt<This> for Thiswhere
This: MediaViewAlg + FormatViewAlg,
impl<This> MediaOutputExt<This> for Thiswhere
This: MediaViewAlg + FormatViewAlg,
Source§fn media_output_path(
&self,
media: &<This as MediaSorts>::Media,
format: &<This as MediaSorts>::Format,
target: &OutputTarget,
) -> PathBuf
fn media_output_path( &self, media: &<This as MediaSorts>::Media, format: &<This as MediaSorts>::Format, target: &OutputTarget, ) -> PathBuf
Defines the final path one media item publishes its selected format at.
Source§impl<This> MetadataExt<This> for Thiswhere
This: MetadataAlg,
impl<This> MetadataExt<This> for Thiswhere
This: MetadataAlg,
Source§fn text_metadata(
&self,
key: impl Into<String>,
value: impl Into<String>,
) -> <This as MediaSorts>::Metadata
fn text_metadata( &self, key: impl Into<String>, value: impl Into<String>, ) -> <This as MediaSorts>::Metadata
Defines a record containing one textual field.
Source§impl<This> ObservationLaws<This> for Thiswhere
This: MetadataAlg,
impl<This> ObservationLaws<This> for Thiswhere
This: MetadataAlg,
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
Source§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
Source§impl<This> XLaws<This> for Thiswhere
This: XRequestAlg + XRequestViewAlg,
impl<This> XLaws<This> for Thiswhere
This: XRequestAlg + XRequestViewAlg,
Source§fn x_laws(&self) -> Result<(), Error>
fn x_laws(&self) -> Result<(), Error>
Checks that an address, a request, and a way of taking each mean one thing.
The laws checked are:
- every address of one tweet names that tweet, however it was written;
- an address naming no tweet names none, whatever else it looks like;
- asking about one tweet is a function of which tweet it is, and always carries a token;
- every way of taking is named by its own word and says what it does;
- taking everything accepts every kind, and each other way accepts its own and no other;
- every kind the answer names reads back as itself.
§Errors
Returns the first violated law.
Source§impl<This> XRequestExt<This> for Thiswhere
This: XRequestAlg,
impl<This> XRequestExt<This> for Thiswhere
This: XRequestAlg,
Source§impl<This, Request, RequestError, ResponseError, ChallengeError, FetchError, PublishError, Event, Progress> YoutubeApplicationExt<This, Request, RequestError, ResponseError, ChallengeError, FetchError, PublishError, Event, Progress> for Thiswhere
This: YoutubeRequestAlg<Request = Request> + YoutubeClientAlg + YoutubeProgramAlg + YoutubeRequestBytesAlg<Error = RequestError> + YoutubeResponseAlg<Error = ResponseError> + YoutubeChallengeAlg<Error = ChallengeError> + YoutubeSolutionAlg + YoutubeUrlAlg + MetadataAlg + FormatAlg + ExtractionAlg + ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<Request> + FetchStreamAlg<Request, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event> + YoutubeSorts,
FetchError: Display,
PublishError: Display,
impl<This, Request, RequestError, ResponseError, ChallengeError, FetchError, PublishError, Event, Progress> YoutubeApplicationExt<This, Request, RequestError, ResponseError, ChallengeError, FetchError, PublishError, Event, Progress> for Thiswhere
This: YoutubeRequestAlg<Request = Request> + YoutubeClientAlg + YoutubeProgramAlg + YoutubeRequestBytesAlg<Error = RequestError> + YoutubeResponseAlg<Error = ResponseError> + YoutubeChallengeAlg<Error = ChallengeError> + YoutubeSolutionAlg + YoutubeUrlAlg + MetadataAlg + FormatAlg + ExtractionAlg + ExtractionViewAlg + MediaViewAlg + FormatViewAlg + FormatSelectionApplyAlg + FormatSourceAlg<Request> + FetchStreamAlg<Request, Error = FetchError> + AtomicPublishAlg<Error = PublishError> + DownloadObservationAlg<Event = Event, Progress = Progress> + DownloadProgressAlg<Progress = Progress> + DownloadReportAlg<Event = Event> + YoutubeSorts,
FetchError: Display,
PublishError: Display,
Source§fn download_youtube(
&self,
url: &str,
selection: &<This as MediaSorts>::Selection,
target: &OutputTarget,
) -> Result<PathBuf, YoutubeApplicationError<RequestError, ResponseError, ChallengeError, FetchError, PublishError>>
fn download_youtube( &self, url: &str, selection: &<This as MediaSorts>::Selection, target: &OutputTarget, ) -> Result<PathBuf, YoutubeApplicationError<RequestError, ResponseError, ChallengeError, FetchError, PublishError>>
Downloads one Youtube URL through exactly one selected direct format.
§Errors
Returns Youtube extraction, selection, retrieval, or publication failure.
Source§impl<This, ChallengeError> YoutubeChallengeExt<This, ChallengeError> for This
impl<This, ChallengeError> YoutubeChallengeExt<This, ChallengeError> for This
Source§fn format_challenges<'a>(
&'a self,
formats: impl IntoIterator<Item = &'a YoutubeFormat> + 'a,
) -> impl Iterator<Item = YoutubeChallenge> + 'a
fn format_challenges<'a>( &'a self, formats: impl IntoIterator<Item = &'a YoutubeFormat> + 'a, ) -> impl Iterator<Item = YoutubeChallenge> + 'a
Observes every distinct challenge the formats pose, in first-appearance order.
Source§fn grant_format(
&self,
format: &YoutubeFormat,
solutions: &<This as YoutubeSorts>::Solutions,
) -> YoutubeGrant
fn grant_format( &self, format: &YoutubeFormat, solutions: &<This as YoutubeSorts>::Solutions, ) -> YoutubeGrant
Grants one format its retrievable URL under already resolved challenges.
Source§fn grant_formats(
&self,
program: &str,
formats: &[YoutubeFormat],
) -> Result<Vec<YoutubeGrant>, ChallengeError>
fn grant_formats( &self, program: &str, formats: &[YoutubeFormat], ) -> Result<Vec<YoutubeGrant>, ChallengeError>
Resolves the challenges one program poses once, and grants every format in order.
§Errors
Returns the interpreter-specific resolution failure.
Source§impl<This, ChallengeError> YoutubeChallengeLaws<This, ChallengeError> for This
impl<This, ChallengeError> YoutubeChallengeLaws<This, ChallengeError> for This
Source§fn youtube_granting_laws(&self) -> Result<(), Error>where
ChallengeError: Debug,
fn youtube_granting_laws(&self) -> Result<(), Error>where
ChallengeError: Debug,
Checks that granting is total, ordered, and withholds only what stays unresolved.
The laws checked are:
- granting yields exactly one outcome per described format, in declaration order;
- a source posing no challenge is granted its stated URL unchanged;
- an unresolved signature withholds exactly the formats it guards, and no others;
- an unresolved throttling parameter governs the rate of a still retrievable URL.
§Errors
Returns the first violated law, or the interpreter’s resolution failure.
Source§impl<This, RequestError, ResponseError, ChallengeError> YoutubeExtractionExt<This, RequestError, ResponseError, ChallengeError> for Thiswhere
This: YoutubeRequestAlg + YoutubeClientAlg + YoutubeProgramAlg + YoutubeRequestBytesAlg<Error = RequestError> + YoutubeResponseAlg<Error = ResponseError> + YoutubeChallengeAlg<Error = ChallengeError> + YoutubeSolutionAlg + YoutubeUrlAlg + MetadataAlg + FormatAlg + ExtractionAlg,
impl<This, RequestError, ResponseError, ChallengeError> YoutubeExtractionExt<This, RequestError, ResponseError, ChallengeError> for Thiswhere
This: YoutubeRequestAlg + YoutubeClientAlg + YoutubeProgramAlg + YoutubeRequestBytesAlg<Error = RequestError> + YoutubeResponseAlg<Error = ResponseError> + YoutubeChallengeAlg<Error = ChallengeError> + YoutubeSolutionAlg + YoutubeUrlAlg + MetadataAlg + FormatAlg + ExtractionAlg,
Source§fn extract_youtube(
&self,
url: &str,
) -> Result<<This as MediaSorts>::Extraction, YoutubeError<RequestError, ResponseError, ChallengeError>>
fn extract_youtube( &self, url: &str, ) -> Result<<This as MediaSorts>::Extraction, YoutubeError<RequestError, ResponseError, ChallengeError>>
Extracts one Youtube watch URL into a preference-ordered media catalog.
§Errors
Returns URL, request, response, availability, challenge, or empty-catalog failure.
Source§fn granted_catalog(
&self,
id: &str,
api_key: &str,
visitor: Option<&str>,
program: &str,
) -> Result<YoutubePlayer, YoutubeError<RequestError, ResponseError, ChallengeError>>
fn granted_catalog( &self, id: &str, api_key: &str, visitor: Option<&str>, program: &str, ) -> Result<YoutubePlayer, YoutubeError<RequestError, ResponseError, ChallengeError>>
Observes the union of the catalogs this interpreter’s clients are granted, in claim order.
Each client is granted a different catalog, and neither is the whole truth: one states a muxed representation carrying both streams, another states every adaptive representation on its own. A client refused states nothing about the others.
§Errors
Returns request or response failure.
Source§fn youtube_format(
&self,
format: YoutubeFormat,
url: String,
) -> <This as MediaSorts>::Format
fn youtube_format( &self, format: YoutubeFormat, url: String, ) -> <This as MediaSorts>::Format
Defines one generic format from Youtube player observations and its granted URL.
Source§impl<This, Request> YoutubeRequestLaws<This, Request> for This
impl<This, Request> YoutubeRequestLaws<This, Request> for This
Source§fn youtube_request_laws(&self) -> Result<(), Error>
fn youtube_request_laws(&self) -> Result<(), Error>
Checks that each request is a function of its arguments and distinct from the others.
The laws checked are:
- a request is a function of the values naming it;
- retrieving a watch page, a player catalog, and media are three distinct requests;
- the player request depends on the identity, the key, and what the client claims.
§Errors
Returns the first violated law.
Source§impl<This> YoutubeUrlLaws<This> for Thiswhere
This: YoutubeUrlAlg,
impl<This> YoutubeUrlLaws<This> for Thiswhere
This: YoutubeUrlAlg,
Source§fn youtube_url_laws(&self) -> Result<(), Error>
fn youtube_url_laws(&self) -> Result<(), Error>
Checks that the two substitutions are independent and that answering is observable.
The laws checked are:
- a solved throttling parameter is the one the answered URL then poses;
- attaching a solved signature leaves the throttling challenge unchanged.
§Errors
Returns the first violated law.