Skip to main content

DataView

Struct DataView 

Source
pub struct DataView<'a> { /* private fields */ }
Expand description

Leitura do dataset.

Implementations§

Source§

impl<'a> DataView<'a>

Source

pub fn is_waiting(&self) -> bool

A gravação espera o backend (o before_post, o before_delete ou o on_apply_updates remotos): os controles DB* não deixam mexer até a resposta.

Source

pub fn id(&self) -> ComponentId

Source

pub fn state(&self) -> DataSetState

Source

pub fn is_active(&self) -> bool

Source

pub fn record_count(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn rec_no(&self) -> Option<usize>

Posição do registro atual (na inserção, onde o novo vai entrar).

Source

pub fn bof(&self) -> bool

Como o Bof do Delphi: verdadeiro depois de first ou de tentar voltar antes do primeiro registro.

Source

pub fn eof(&self) -> bool

Como o Eof do Delphi: verdadeiro depois de last ou de tentar avançar além do último registro (então while !eof { ...; next } passa por todos).

Source

pub fn at_first(&self) -> bool

Está no primeiro registro (para habilitar botões de navegação).

Source

pub fn at_last(&self) -> bool

Está no último registro.

Source

pub fn field_names(&self) -> Vec<String>

Source

pub fn field(&self, name: &str) -> DataResult<&'a Field>

O componente Field de uma coluna.

Source

pub fn field_id(&self, name: &str) -> DataResult<ComponentId>

Id do componente Field de uma coluna.

Source

pub fn value(&self, name: &str) -> DataResult<Value>

Valor do campo no registro atual (Null se não houver registro).

Source

pub fn lookup( &self, key_fields: &str, keys: &[Value], result_field: &str, ) -> Option<Value>

Procura o registro com key_fields = keys e devolve o result_field dele (como o Lookup do Delphi). None se não achar.

Source

pub fn text(&self, name: &str) -> DataResult<String>

Texto para exibir (com display_format, on_get_text…).

Source

pub fn field_errors(&self) -> Vec<(String, String)>

Os erros de validação vindos do backend (campo, mensagem).

Source

pub fn edit_text(&self, name: &str) -> DataResult<String>

Texto para editar (sem a formatação de exibição).

Source

pub fn text_at(&self, row: usize, name: &str) -> DataResult<String>

Texto de exibição de um campo num registro qualquer (com o display_format): o dos relatórios.

Source

pub fn format(&self, name: &str, value: &Value) -> DataResult<String>

value como o campo name exibe (a soma de um campo em moeda sai em moeda).

Source

pub fn value_at(&self, row: usize, name: &str) -> DataResult<Value>

Valor de um campo num registro qualquer (para grids).

Source

pub fn has_more(&self) -> bool

Há mais registros no backend além dos carregados (busca sob demanda).

Source

pub fn update_status(&self) -> Option<RowStatus>

A situação do registro atual (como o UpdateStatus): inalterado, alterado ou incluído desde a carga (ou desde o último apply_updates). Durante uma inclusão, Inserted.

Source

pub fn visible_count(&self) -> usize

Quantas linhas um grid mostra: os registros mais o novo, durante a inclusão.

Source

pub fn visible_current(&self) -> Option<usize>

Linha atual na contagem de visible_count.

Source

pub fn visible_row(&self, index: usize) -> Option<RowInfo<'a>>

Informações da linha index (na contagem de visible_count).

Source

pub fn visible_value(&self, index: usize, name: &str) -> DataResult<Value>

Valor de um campo na linha index (na contagem de visible_count); a linha em edição ou inclusão mostra o que está sendo digitado.

Source

pub fn visible_text(&self, index: usize, name: &str) -> DataResult<String>

Texto de exibição de um campo na linha index.

Source

pub fn change_count(&self) -> usize

Quantas alterações ainda não foram aceitas pelo backend.

Source

pub fn delta(&self) -> DataResult<Vec<Change>>

As alterações pendentes, prontas para o backend.

Source

pub fn delta_with_details(&self) -> DataResult<Vec<Change>>

O delta que vai ao backend no apply_updates: o deste dataset com os dos detalhes (os que não têm apply_separately, e os detalhes deles), na ordem segura para gravar: as inclusões e alterações do mestre, depois tudo dos detalhes, e por último as exclusões do mestre (os itens saem antes do pedido; o pedido entra antes dos itens). O detalhe incluído sob um mestre também incluído leva o MasterLink.

Trait Implementations§

Source§

impl<'a> Clone for DataView<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for DataView<'a>

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for DataView<'a>

§

impl<'a> !Send for DataView<'a>

§

impl<'a> !Sync for DataView<'a>

§

impl<'a> !UnwindSafe for DataView<'a>

§

impl<'a> Forget for DataView<'a>

§

impl<'a> Freeze for DataView<'a>

§

impl<'a> Unpin for DataView<'a>

§

impl<'a> UnsafeUnpin for DataView<'a>

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> ErasedDestructor for T
where T: 'static,

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

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.