Struct msq::Filter

source · []
pub struct Filter { /* private fields */ }
Expand description

Filter builder - Construct your filter to filter out server results

Quick Start

use msq::Filter;

let filter = Filter::new()      // Create a Filter builder
        .appid(240)             // appid of 240 (CS:S)
        .nand()                 // Start of NAND special filter
            .map("de_dust2")        // Map is de_dust2
            .empty(true)            // Server is empty
        .end()                  // End of NAND special filter
        .gametype(&vec!["friendlyfire", "alltalk"]);

Implementations

👎 Deprecated since 0.2.0:

Replaced with as_string (name change)

Returns a string representing the filters

Returns a string representing the filters

Returns a new Filter struct, used for string builder

Examples
// Filter
use msq::Filter;
let filter = Filter::new()
    .appid(240)
    .full(false)
    .map("de_dust2");

A special filter, specifies that servers matching any of the following [x] conditions should not be returned. See end method to see examples on usage.

A special filter, specifies that servers matching all of the following [x] conditions should not be returned. See end method to see examples on usage.

End the special filter (nor, nand) You must use this method after each nor/nand special filter method being used

Examples

Using the NAND filter:

use msq::Filter;
let filter = Filter::new()
    .appid(240)
    .nand()     // Exclude servers that has de_dust2 AND is empty
        .map("de_dust2")
        .empty(true)
    .end()      // Ends the NAND special filter
    .gametype(&vec!["friendlyfire", "alltalk"]);

Using the NOR filter:

use msq::Filter;
let filter = Filter::new()
    .appid(240)
    .nor()      // Exclude servers that has de_dust2 OR is empty
        .map("de_dust2")
        .empty(true)
    .end()      // Ends the NOR special filter
    .gametype(&vec!["friendlyfire", "alltalk"]);

Filters if the servers running dedicated

Arguments
  • is_dedicated - true = dedicated, false = not dedicated

Servers using anti-cheat technology (VAC, but potentially others as well)

Arguments
  • hasac - true = secure, false = not secure

Servers running the specified modification (ex: cstrike)

Arguments
  • modg - The modification name (ex: cstrike)

Servers running the specified map (ex: cs_italy)

Arguments
  • mapn - The current map it’s playing (ex: cs_italy)

Servers running on a Linux platform

Arguments
  • runslinux - true = Runs on Linux, false = Does not runs on Linux

Servers that are password protected

Arguments
  • protected - true = Password protected, false = Not password protected

Servers that are full

Arguments
  • is_full - true = Server’s full, false = Server’s not full

Servers that are spectator proxies

Arguments
  • specprox - true = A spectator proxies, false = Not a spectator proxies

Servers that are running game [appid]

Arguments
  • appid - The appid of the server: (EX: 240 (for CS:S))

Servers that are NOT running game [appid]

Arguments
  • appid - The appid of the server: (EX: 240 (for CS:S))

Servers that are empty

Arguments
  • is_empty - true = Empty, false = Not empty

Servers that are whitelisted

Arguments
  • white - true = Whitelisted, false = Not whitelisted

Servers with all of the given tag(s) in sv_tags

Arguments
  • tags - A vector of strings which represents a tag from sv_tags
Example
use msq::Filter;
let filter = Filter::new()
    .appid(240)
    .gametype(&vec!["friendlyfire", "alltalk"]);

If you put in an empty vector, it will return nothing

Servers with all of the given tag(s) in their ‘hidden’ tags (L4D2)

Arguments
  • tags - A vector of strings which represents a tag from sv_tags

Servers with any of the given tag(s) in their ‘hidden’ tags (L4D2)

Arguments
  • tags - A vector of strings which represents a tag from sv_tags

Servers with their hostname matching [hostname] (can use * as a wildcard)

Arguments
  • hostname - String of matching hostname (EX: 1.2.*)

Servers running version [version] (can use * as a wildcard)

Arguments
  • ver - String of matching version

Return only one server for each unique IP address matched

Arguments
  • one_server - true = Return one server

Return only servers on the specified IP address (port supported and optional)

Arguments
  • ipaddr - String of the IP address to match

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.