Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

482 B
Raw Blame
//! Loopback listeners for this crate's tests: the fake nodes bind through
//! [`bind`], so a sandbox that denies loopback gets a message naming it
//! instead of a bare `PermissionDenied` (#2886).

use std::net::TcpListener;

/// Binds an ephemeral port on 127.0.0.1, or panics with a message that says
/// the tests need loopback networking.
#[track_caller]
pub(crate) fn bind() -> TcpListener {
    xerj_common::loopback_test::expect_loopback(TcpListener::bind("127.0.0.1:0"))
}