Struct RouteBuilder

Source
pub struct RouteBuilder {
Show 18 fields pub id: Option<String>, pub name: Option<String>, pub desc: Option<String>, pub status: Option<i64>, pub plugins: Option<Plugins>, pub uri: Option<String>, pub uris: Option<Vec<String>>, pub host: Option<String>, pub hosts: Option<Vec<String>>, pub remote_addr: Option<String>, pub remote_addrs: Option<Vec<String>>, pub methods: Option<Vec<String>>, pub upstream: Option<UpstreamRequest>, pub upstream_id: Option<String>, pub service_id: Option<String>, pub timeout: Option<ApisixTimeout>, pub enable_websocket: Option<bool>, pub priority: Option<i64>,
}

Fields§

§id: Option<String>§name: Option<String>§desc: Option<String>§status: Option<i64>§plugins: Option<Plugins>§uri: Option<String>§uris: Option<Vec<String>>§host: Option<String>§hosts: Option<Vec<String>>§remote_addr: Option<String>§remote_addrs: Option<Vec<String>>§methods: Option<Vec<String>>§upstream: Option<UpstreamRequest>§upstream_id: Option<String>§service_id: Option<String>§timeout: Option<ApisixTimeout>§enable_websocket: Option<bool>§priority: Option<i64>

Implementations§

Source§

impl RouteBuilder

Source

pub fn new() -> Self

Source

pub fn with_id(self, id: String) -> Self

Source

pub fn with_name(self, name: String) -> Self

Identifier for the Route

Source

pub fn with_desc(self, desc: String) -> Self

Description of usage scenarios

Source

pub fn with_status(self, status: i64) -> Self

Enables the current Route. Set to 1 (enabled) by default 1 to enable, 0 to disable

Source

pub fn with_plugins(self, plugins: Plugins) -> Self

Plugins that are executed during the request/response cycle. See Plugins for more

Source

pub fn with_uri(self, uri: String) -> Self

Matches the uri. For more advanced matching see Router Example: “/hello”

Source

pub fn with_uris(self, uris: Vec<String>) -> Self

Matches with any one of the multiple uris specified in the form of a non-empty list Example: [“/hello”, “/word”]

Source

pub fn with_host(self, host: String) -> Self

Matches with domain names such as foo.com or PAN domain names like *.foo.com. Example: “foo.com”

Source

pub fn with_hosts(self, hosts: Vec<String>) -> Self

Matches with any one of the multiple hosts specified in the form of a non-empty list Example: [“foo.com”, “bar.com”]

Source

pub fn with_remote_addr(self, remote_addr: String) -> Self

Matches with the specified IP address in standard IPv4 format (192.168.1.101), CIDR format (192.168.1.0/24), or in IPv6 format (::1, fe80::1, fe80::1/64) Example: “192.168.1.0/24”

Source

pub fn with_remote_addrs(self, remote_addrs: Vec<String>) -> Self

Matches with any one of the multiple remote_addrs specified in the form of a non-empty list Example: [“127.0.0.1”, “192.0.0.0/8”, “::1”]

Source

pub fn with_methods(self, methods: Vec<String>) -> Self

Matches with the specified methods. Matches all methods if empty or unspecified Example: [“GET”, “POST”]

Source

pub fn with_upstream(self, upstream: UpstreamRequest) -> Self

Configuration of the Upstream [@UpstreamRequest]

Source

pub fn with_upstream_id(self, upstream_id: String) -> Self

Id of the Upstream service

Source

pub fn with_service_id(self, service_id: String) -> Self

Configuration of the bound Service

Source

pub fn with_timeout(self, timeout: ApisixTimeout) -> Self

Sets the timeout (in seconds) for connecting to, and sending and receiving messages between the Upstream and the Route. This will overwrite the timeout value configured in your Upstream Example: {“connect”: 0.5,“send”: 0.5,“read”: 0.5}

Source

pub fn with_enable_websocket(self, enable_websocket: bool) -> Self

Enables a websocket. Set to false by default

Source

pub fn priority(self, priority: i64) -> Self

If different Routes matches to the same uri, then the Route is matched based on its priority. A higher value corresponds to higher priority. It is set to 0 by default.

Source

pub fn build(self) -> Result<RouteRequest, ApisixClientError>

Trait Implementations§

Source§

impl Clone for RouteBuilder

Source§

fn clone(&self) -> RouteBuilder

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RouteBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RouteBuilder

Source§

fn default() -> RouteBuilder

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for RouteBuilder

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<RouteRequest> for RouteBuilder

Source§

fn from(route: RouteRequest) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RouteBuilder

Source§

fn eq(&self, other: &RouteBuilder) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for RouteBuilder

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for RouteBuilder

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,