Skip to main content

Crate rsynko_memory

Crate rsynko_memory 

Source
Expand description

§rsynko-memory

rsynko-memory provides deterministic, inspectable in-memory interpreters for the Rsynko specifications. It is a semantic witness and test model, not an application framework.

Reference extractors use explicit URL prefixes and fixed outcomes. Reference processors use a closed transformation language. Neither hides policy inside callbacks.

The in-memory manager interprets the associated manager carriers as ManagerState, SourceRequest, and stable numeric QueueId values. This representation belongs here rather than in the manager specification:

use rsynko_manager::ProgressiveDownloadsExt;
use rsynko_memory::MemoryManager;

let manager = MemoryManager.progressive_downloads([
    "fixture://single-video",
    "https://www.youtube.com/watch?v=VIDEO_ID",
]);
assert_eq!(manager.queue().len(), 2);

Interactive event interpretation uses the same concrete carrier:

use rsynko_manager::{ManagerIntentExt, ManagerIntentOp, ManagerPage};
use rsynko_memory::{DownloadOptions, ManagerState, SourceRequest};

let mut manager = ManagerState::downloads();
manager.apply_manager_event(ManagerIntentOp::AddSources {
    requests: vec![SourceRequest::new(
        "fixture://single-video",
        None,
        DownloadOptions::progressive(),
    )],
});
manager.apply_manager_event(ManagerIntentOp::OpenSelected {});

assert!(matches!(manager.page(), ManagerPage::Details(_)));
assert_eq!(manager.queue().len(), 1);
use rsynko_media::ExtractionExt;
use rsynko_memory::{Extraction, InfoRecord, Media};
use rsynko_memory::{ReferenceExtractor, ReferenceExtractorRegistry};

let result = Extraction::Media(Media::new("42".to_owned(), InfoRecord::default(), Vec::default()));
let mut registry = ReferenceExtractorRegistry::default();
registry.push(ReferenceExtractor::succeeds(
    "example",
    "https://example.test/",
    result.clone(),
));
assert_eq!(registry.extract_url("https://example.test/42"), Ok(result));

Structs§

Artifact
Denotes one artifact owned by the processing pipeline.
ArtifactSet
Stores artifacts by identity for the in-memory processing interpreter.
Collection
Denotes an ordered collection of extraction results.
DownloadOptions
Denotes editable choices for one not-yet-started download.
DownloadProgress
Denotes one monotonic observation of bytes retrieved for a destination.
DownloadSyntax
Reifies download observations as inspectable values.
ExtractorKey
Identifies an extractor independently of its implementation type.
Format
Denotes one alternative representation of a media item.
InfoRecord
Denotes an open metadata record.
ManagerState
Denotes the complete renderer-neutral manager application state.
Media
Denotes one fully described media item.
MediaSyntax
Reifies every media sort as inspectable Rust syntax.
MemoryManager
Selects the deterministic in-memory interpretation of manager carriers.
PlannedChange
Denotes one change a rehearsal stated the transfer would make.
ProcessingProgram
Denotes an ordered sequence of artifact transformations.
ProcessingStep
Denotes application of one processor at one stage.
ProcessingSyntax
Reifies processing programs as ordered inspectable syntax.
ProcessorId
Identifies a processor independently of its implementation type.
QueueEntry
Denotes one source in the in-memory manager collection.
QueueId
Identifies one queue entry independently of list position.
ReferenceDownloadEnv
Interprets fetching, atomic publication, and reporting entirely in memory.
ReferenceExtractor
Interprets one extractor as inspectable prefix matching and a fixed outcome.
ReferenceExtractorRegistry
Interprets an ordered extractor catalog in memory.
ReferenceFormatSelector
Interprets format predicates and selection programs over the reified media sorts.
ReferenceProcessingRefusal
Denotes a processor the reference context refuses to apply.
ReferenceProcessor
Interprets one named artifact transformation in memory.
ReferenceProcessorEnv
Interprets processing programs over an in-memory artifact set.
ReferencePublishError
Denotes publication failure in the deterministic download interpreter.
ReferenceRun
Carries one authored run: the work it has left, what it has said, and whether it was stopped.
ReferenceSession
Attends to runs that say what they were authored to say, one thing per pass.
ReferenceSyncEnv
Runs folder transfers by stating a transcript instead of moving anything.
ReferenceSyncError
Denotes a transfer the reference interpreter refused to run.
ReferenceXEnv
Asks about tweets by writing down the address that would be asked.
ReferenceYoutubeDownloadEnv
Retrieves the representation one Youtube media request states.
ReferenceYoutubeEnv
Interprets the Youtube query surface and resolves only the challenges it was seeded with.
RsyncEndpoint
Denotes one end of a folder transfer.
RsyncSyntax
Interprets the folder-transfer sorts as ordinary in-memory records.
SourceRequest
Denotes one requested source and optional explicit output path.
SyncCommand
Denotes exactly the command one transfer runs.
TextScreen
Renders screens as plain text.
TransferState
Denotes the mechanism-independent state of one transfer.
UrlReference
Denotes a URL whose meaning requires another extraction.
XAttachment
Holds one file a tweet carries.
YoutubeRequestSyntax
Reifies Youtube requests as inspectable domain syntax.

Enums§

ChangeKind
Denotes what one rehearsed change would do to a path.
DownloadEvent
Denotes one terminal download observation.
DownloadObservationOp
Represents one DownloadObservation operation as pure data.
DownloadObservationReply
Represents the reply produced by a DownloadObservation operation.
Extraction
Denotes one step of extraction meaning.
FormatCatalog
Denotes discovery state for selectable formats.
FormatChoice
Selects either the best matching format or one concrete format identity.
FormatPredicate
Denotes a predicate over what one format states about itself.
FormatSelection
Denotes a first-order format-selection program.
InfoValue
Denotes a metadata value without closing the set of extractor-defined fields.
ReferenceArtifactTransform
Denotes an inspectable artifact transformation in the reference interpreter.
ReferenceExtractionError
Denotes failures of the deterministic extraction interpreter.
ReferenceExtractionOutcome
Denotes the result a reference extractor assigns to an accepted URL.
ReferenceFetchError
Denotes retrieval failure in the deterministic download interpreter.
ReferenceProcessingError
Denotes failures of the deterministic processing interpreter.
Rehearsal
Denotes what rehearsal has stated about one request.
SyncObservation
Denotes one thing a running transfer states.
YoutubeRequest
Denotes one request required by Youtube interpretation without choosing HTTP representation.

Constants§

REFERENCE_MEDIA_EXTENSION
Names the container the reference player response states.
REFERENCE_MEDIA_URL
Locates the representation the reference player response describes.
REFERENCE_PLAYER_PROGRAM
States the player program the reference environment resolves challenges under.
REFERENCE_PLAYER_PROGRAM_URL
Locates the player program the reference watch page states.
REFERENCE_VIDEO_ID
Names the video identity that watch URL denotes.
REFERENCE_WATCH_URL
Names the watch URL the reference environment answers.

Traits§

DownloadObservation
Defines the first-order observation stream emitted by one download.
DownloadObservationInterpreter
Interprets one DownloadObservation operation at a time.

Functions§

interpret_selection
Interprets one reified selection program against a preference-ordered catalog.
predicate_accepts
Interprets one reified predicate against one format.
role_accepts
Observes whether one described format carries exactly the streams a role requires.

Type Aliases§

ReferenceLaws
Names the reference composition every law scenario runs against.
ReferenceYoutubeLaws
Names the composition the Youtube law scenarios run against.