Skip to main content

SyncBroker

Struct SyncBroker 

Source
pub struct SyncBroker { /* private fields */ }
Expand description

Adaptador sincrono: envuelve el núcleo async con un runtime propio.

Implementations§

Source§

impl SyncBroker

Source

pub fn connect(params: BrokerParams) -> Result<Self, BrokerError>

Conecta creando el runtime y la sesión async.

Source

pub fn async_core(&self) -> &IqOptionBroker

Acceso al núcleo async (para quien quiera ambos mundos).

Source

pub fn session(&self) -> Result<Session, BrokerError>

Source

pub fn is_connected(&self) -> bool

Source

pub fn disconnect(&mut self) -> Result<(), BrokerError>

Source

pub fn get_balance(&self) -> Result<Balance, BrokerError>

Source

pub fn get_account_type(&self) -> Result<AccountType, BrokerError>

Source

pub fn switch_account(&mut self, kind: AccountType) -> Result<(), BrokerError>

Source

pub fn list_assets(&self) -> Result<Vec<Asset>, BrokerError>

Source

pub fn asset_status(&self, symbol: &str) -> Result<MarketStatus, BrokerError>

Source

pub fn get_candles( &self, req: CandleRequest, ) -> Result<Vec<Candle>, BrokerError>

Source

pub fn subscribe_candles( &self, req: CandleSubscribe, ) -> Result<CandleIter, BrokerError>

Stream de velas como iterador bloqueante.

Source

pub fn get_position_history( &self, symbol: Option<&str>, limit: usize, offset: usize, ) -> Result<PositionHistory, BrokerError>

Source

pub fn get_payout( &self, symbol: &str, expiration_seconds: u64, ) -> Result<Payout, BrokerError>

Source

pub fn quote_payout( &self, symbol: &str, option_type: OptionType, expiration_seconds: u64, amount: f64, ) -> Result<PayoutQuote, BrokerError>

Cotización por expiración y tipo de opción.

Source

pub fn get_asset_profile( &self, symbol: &str, ) -> Result<AssetProfile, BrokerError>

Source

pub fn get_technical_indicators( &self, symbol: &str, ) -> Result<TechnicalIndicators, BrokerError>

Source

pub fn subscribe_live_deals(&self, symbol: &str) -> Result<(), BrokerError>

Source

pub fn subscribe_commission_changes(&self) -> Result<(), BrokerError>

Source

pub fn events(&self) -> Result<EventIter, BrokerError>

Iterador bloqueante de eventos (cierre, balance, ticks, deals…).

Source

pub fn buy_binary(&self, req: BuyBinaryRequest) -> Result<OrderId, BrokerError>

Source

pub fn buy_digital_spot( &self, req: BuyDigitalRequest, ) -> Result<OrderId, BrokerError>

Source

pub fn sell_option(&self, order_id: &OrderId) -> Result<(), BrokerError>

Source

pub fn get_operation_result( &self, order_id: &OrderId, ) -> Result<OperationResult, BrokerError>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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: Sized + 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: Sized + 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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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