Skip to main content

Crate pesto

Crate pesto 

Source
Expand description

Public API of pesto, intended for integration with upapasta, penne and sugo.

pesto is a fast, lean Usenet poster: it yEnc-encodes files, posts the resulting articles over NNTP and emits an .nzb file. See ROADMAP.md for the development plan.

§Embedding

The minimal surface for embedding callers is post: pass a resolved config::Config and the list of walk::InputFiles; get back a poster::PostOutcome. Progress events are delivered on the progress::ProgressReceiver returned alongside the outcome; drop it to silence reporting.

ⓘ
use pesto::{config::Config, walk::InputFile};

let config = Config { /* ... */ };
let files = vec![InputFile { path: "movie.mkv".into(), real_name: None }];
let (outcome, _events) = pesto::post(config, files).await?;
println!("posted {} segments", outcome.segments.len());

The supported embedding surface and its compatibility tiers are documented in docs/pesto-embedding-api.md in the workspace repository. Child modules that only organize an implementation are private; use the items re-exported by their domain facade (for example, config and yenc).

Re-exports§

pub use parmesan as par2;

Modules§

article
Article assembly: the Usenet headers (From, Newsgroups, Subject, Message-ID, Date) wrapped around a yEnc-encoded body, plus unique Message-ID generation.
cancel
Unified cancellation support for pesto.
compress
Archive compression before posting (Phase 13).
config
history
Upload history log.
hooks
Post-upload hook execution.
logging
Logging initialisation for the --verbose flag.
memory
Process memory footprint: address-space accounting and startup tuning.
nfo
NFO file generation.
nntp
NNTP client: TLS connection, authentication and the POST command.
notify
Completion notifications: webhook (Discord / Slack / Telegram / generic) and ntfy.sh topics.
nzb
.nzb generation, parsing and the shared metadata model.
poster
Parallel posting: the orchestration that ties together file reading, yEnc encoding, article assembly and the NNTP client.
progress
Progress reporting.
resume
Upload resume: persist already-posted segments so an interrupted run can continue without re-sending articles the server already accepted.
spool
Type-1 resume spool: cache the fully-encoded article (headers + yEnc body, under the exact Message-ID it was sent with) for a segment right before it goes over the wire, so a POST whose 240 acknowledgement is lost to a dropped connection can be resumed by replaying the exact same bytes under the exact same Message-ID — instead of silently re-encoding and re-posting under a fresh one, which risks a duplicate article on the server if the original POST actually succeeded.
ui
Upload progress presentation.
update
pesto --update: fetch the latest pesto-v* GitHub release for the platform pesto is currently running on, verify its SHA256 against the SHA256SUMS file published alongside it, and replace the running binary in place.
upload
Full upload pipeline: compress → post → NZB → history → notifications → hooks.
walk
Expansion of CLI path arguments into a flat list of files to post.
yenc
yEnc encoder.

Constants§

DISPLAY_VERSION
Shown by --version and the startup banner.

Functions§

post
Post files to Usenet using config and return the outcome together with a progress::ProgressReceiver the caller can drain for live updates.
post_cancelable
Like post but accepts an external cancel flag.
post_pausable
Like post_cancelable but also accepts an external pause flag.