Skip to main content

Regex

Struct Regex 

Source
pub struct Regex;
Expand description

Операции REGEX. Состояния не хранит: каждая операция получает исполнитель и конфигурацию явно.

Implementations§

Source§

impl Regex

Source

pub async fn announce( runtime: &GnunetRuntime, config: &Config, pattern: &str, refresh_delay: Duration, compression: u16, ) -> Result<RegexAnnouncement, RegexError>

Объявляет, что этот узел принимает строки, подходящие под pattern.

refresh_delay — как часто объявление обновляется в DHT. compression — на сколько символов сжимаются пути автомата: большее значение уменьшает число записей в DHT. Объявление действует, пока жив возвращённый RegexAnnouncement.

Source

pub async fn search( runtime: &GnunetRuntime, config: &Config, query: &str, ) -> Result<RegexSearch, RegexError>

Ищет узлы, чьё выражение принимает строку query, с ограничениями по умолчанию.

Source

pub async fn search_with_options( runtime: &GnunetRuntime, config: &Config, query: &str, options: RegexSearchOptions, ) -> Result<RegexSearch, RegexError>

То же, что search, с явными ограничениями.

Source

pub async fn ipv4_search_string( runtime: &GnunetRuntime, ip: Ipv4Addr, port: u16, ) -> Result<String, RegexError>

Строка поиска для адреса IPv4 и порта в том виде, в каком её ждут выражения выходных узлов VPN.

Source

pub async fn ipv6_search_string( runtime: &GnunetRuntime, ip: Ipv6Addr, port: u16, ) -> Result<String, RegexError>

То же для адреса IPv6.

Source

pub async fn ipv4_policy_to_regex( runtime: &GnunetRuntime, policy: &str, ) -> Result<String, RegexError>

Превращает политику выхода IPv4 (перечень разрешённых и запрещённых сетей и портов) в регулярное выражение для announce.

Source

pub async fn ipv6_policy_to_regex( runtime: &GnunetRuntime, policy: &str, ) -> Result<String, RegexError>

То же для политики IPv6.

Auto Trait Implementations§

§

impl Freeze for Regex

§

impl RefUnwindSafe for Regex

§

impl Send for Regex

§

impl Sync for Regex

§

impl Unpin for Regex

§

impl UnsafeUnpin for Regex

§

impl UnwindSafe for Regex

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.