Struct rustdx::tcp::stock::Xdxr

source ·
pub struct Xdxr<'d> {
    pub send: Box<[u8]>,
    pub market: u16,
    pub code: &'d str,
    pub response: Vec<u8>,
    pub count: Option<usize>,
    pub data: Vec<XdxrData>,
}
Expand description

对应 pytdx 的 hq.get_xdxr_info、GetXdXrInfo。获取单只股票的股本变迁信息。

Fields§

§send: Box<[u8]>§market: u16§code: &'d str§response: Vec<u8>§count: Option<usize>§data: Vec<XdxrData>

Trait Implementations§

source§

impl<'d> Clone for Xdxr<'d>

source§

fn clone(&self) -> Xdxr<'d>

Returns a copy 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<'d> Debug for Xdxr<'d>

source§

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

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

impl<'d> Default for Xdxr<'d>

source§

fn default() -> Self

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

impl<'a> Tdx for Xdxr<'a>

source§

const SEND: &'static [u8] = _

待发送的字节。所有发送请求的字节由两部分组成: Read more
source§

const TAG: &'static str = "除权除息"

描述此次 tcp 连接的用途,目前用于记录日志。
source§

type Item = [XdxrData]

source§

fn send(&mut self) -> &[u8]

真正发送的字节。
source§

fn parse(&mut self, v: Vec<u8>)

解析响应的字节。
source§

fn result(&self) -> &Self::Item

解析后的结果。可以是引用,也可以是 owned type 。
source§

const LEN: usize = _

发送的字节的长度。每种请求所发送的字节长度是已知的。默认为 Tdx::SEND 的长度。
source§

fn recv(&mut self, tcp: &mut Tcp) -> Result<Vec<u8>>

得到响应的字节。响应的字节长度无法预测。
source§

fn recv_parsed(&mut self, tcp: &mut Tcp) -> Result<&Self::Item>

得到和解析响应的字节,并返回解析的数据。

Auto Trait Implementations§

§

impl<'d> Freeze for Xdxr<'d>

§

impl<'d> RefUnwindSafe for Xdxr<'d>

§

impl<'d> Send for Xdxr<'d>

§

impl<'d> Sync for Xdxr<'d>

§

impl<'d> Unpin for Xdxr<'d>

§

impl<'d> UnwindSafe for Xdxr<'d>

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, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> 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.