Skip to main content

FbStream

Struct FbStream 

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

A conexão enquadrada com um servidor Firebird.

Implementations§

Source§

impl FbStream

Source

pub fn new(sock: TcpStream) -> Self

Source

pub fn mark_broken(&mut self)

Marca o stream como inutilizável (erro de I/O ou desync de protocolo).

Source

pub fn is_broken(&self) -> bool

Se o stream sofreu um erro de I/O ou desync e não deve ser reutilizado.

Source

pub fn enable_encryption( &mut self, read: Box<dyn Cipher>, write: Box<dyn Cipher>, )

Instala as cifras de wire negociadas. Chamado uma vez, logo após o handshake de crypt; todo o tráfego a partir deste ponto é criptografado.

Source

pub fn is_encrypted(&self) -> bool

Source

pub fn peer_ip(&self) -> Option<IpAddr>

O IP do servidor (peer) deste socket. Usado para abrir o canal auxiliar de eventos no mesmo host.

Source

pub fn enqueue(&mut self, w: &XdrWriter)

Anexa uma operação construída em XDR ao buffer de envio. Use Self::flush para empurrá-la ao socket. A maioria dos chamadores usa Self::send.

Source

pub fn flush(&mut self) -> Result<()>

Descarrega (flush) toda a saida em buffer, criptografando se uma cifra estiver instalada.

Source

pub fn send(&mut self, w: &XdrWriter) -> Result<()>

Enfileira e imediatamente descarrega (flush) uma operação.

Source

pub fn read_raw(&mut self, n: usize) -> Result<Vec<u8>>

Consome n bytes do cursor de leitura (sem preenchimento (padding) XDR).

Source

pub fn read_i32(&mut self) -> Result<i32>

Source

pub fn read_i64(&mut self) -> Result<i64>

Source

pub fn read_f64(&mut self) -> Result<f64>

Source

pub fn read_pad(&mut self, data_len: usize) -> Result<()>

Pula o preenchimento (padding) XDR para que o deslocamento absoluto de bytes desde o início do fluxo (stream) caia em um limite de 4 bytes. Rastreamos o alinhamento via data_len, não rpos, então o chamador passa o comprimento do campo de dados recém-lido.

Source

pub fn read_bytes(&mut self) -> Result<Vec<u8>>

Lê um buffer opaco com prefixo de comprimento, alinhado em 4 bytes.

Source

pub fn read_quad(&mut self) -> Result<u64>

Lê um quad do Firebird (id de blob/transação): duas palavras XDR, alta depois baixa.

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, 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> 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 = 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