Skip to main content

User

Struct User 

Source
pub struct User {
    pub id: Uuid,
}

Fields§

§id: Uuid

Implementations§

Source§

impl User

Source

pub async fn add_account(&self, script: &[u8]) -> Result<Account, ServerError>

Source

pub async fn create_account( &self, name: &str, parent: Option<Uuid>, ) -> Result<Account, ServerError>

Source

pub async fn update_account_tags( &self, a: &Account, tags: &[Tag], ) -> Result<(), ServerError>

Source

pub async fn set_account_tag( &self, a: &Account, t: &Tag, ) -> Result<(), ServerError>

Source

pub async fn get_account_tags( &self, a: &Account, ) -> Result<Vec<Tag>, ServerError>

Source

pub async fn list_transaction_ids_by_account( &self, account_id: Uuid, ) -> Result<Vec<Uuid>, ServerError>

Source

pub async fn get_account_tag( &self, a: &Account, tag: &String, ) -> Result<Tag, ServerError>

Source§

impl User

Source

pub async fn add_commodity( &self, script: &[u8], ) -> Result<Commodity, ServerError>

Source

pub async fn create_commodity( &self, symbol: String, name: String, ) -> Result<Commodity, ServerError>

Source

pub async fn update_commodity_tags( &self, c: &Commodity, tags: &[Tag], ) -> Result<(), ServerError>

Source

pub async fn set_commodity_tag( &self, c: &Commodity, t: &Tag, ) -> Result<(), ServerError>

Source

pub async fn get_commodity_tags( &self, c: &Commodity, ) -> Result<Vec<Tag>, ServerError>

Source

pub async fn get_commodity_tag( &self, c: &Commodity, tag: &String, ) -> Result<Tag, ServerError>

Source§

impl User

Source

pub async fn list_scripts(&self) -> Result<Vec<ScriptInfo>, ServerError>

Source

pub async fn get_script(&self, id: Uuid) -> Result<ScriptDetail, ServerError>

Source

pub async fn create_script( &self, bytecode: Vec<u8>, name: Option<String>, ) -> Result<Uuid, ServerError>

Source

pub async fn update_script_bytecode( &self, id: Uuid, bytecode: Vec<u8>, ) -> Result<(), ServerError>

Source

pub async fn delete_script(&self, id: Uuid) -> Result<(), ServerError>

Source

pub async fn set_script_enabled( &self, id: Uuid, enabled: bool, ) -> Result<(), ServerError>

Source

pub async fn update_script_name( &self, id: Uuid, name: Option<String>, ) -> Result<(), ServerError>

Source§

impl User

Source

pub async fn create_tag( &self, name: String, value: String, description: Option<String>, ) -> Result<Uuid, ServerError>

Source

pub async fn list_tags(&self) -> Result<Vec<Tag>, ServerError>

Source

pub async fn get_tag(&self, id: Uuid) -> Result<Tag, ServerError>

Source

pub async fn update_tag( &self, id: Uuid, name: String, value: String, description: Option<String>, ) -> Result<(), ServerError>

Source

pub async fn get_transaction_tags( &self, tx_id: Uuid, ) -> Result<Vec<Tag>, ServerError>

Source

pub async fn create_transaction_tag( &self, tx_id: Uuid, name: String, value: String, description: Option<String>, ) -> Result<Uuid, ServerError>

Source

pub async fn delete_tag(&self, id: Uuid) -> Result<(), ServerError>

Cascade-delete a tag: detach from every join table, then drop the row from tags. Used by user-initiated tag deletion in the UI; see detach_*_tag + cleanup_orphan_tag for the “remove from one entity, drop only if no longer referenced” pattern.

Source

pub async fn detach_transaction_tag( &self, tx_id: Uuid, tag_id: Uuid, ) -> Result<(), ServerError>

Source

pub async fn detach_split_tag( &self, split_id: Uuid, tag_id: Uuid, ) -> Result<(), ServerError>

Source

pub async fn detach_account_tag( &self, account_id: Uuid, tag_id: Uuid, ) -> Result<(), ServerError>

Source

pub async fn detach_commodity_tag( &self, commodity_id: Uuid, tag_id: Uuid, ) -> Result<(), ServerError>

Source

pub async fn cleanup_orphan_tag(&self, tag_id: Uuid) -> Result<(), ServerError>

If tag_id is no longer referenced by any join table, delete the canonical row. Idempotent.

Source

pub async fn list_tag_names( &self, scope: TagScope, ) -> Result<Vec<String>, ServerError>

Source

pub async fn list_tag_values_for( &self, scope: TagScope, tag_name: &str, ) -> Result<Vec<String>, ServerError>

Source

pub async fn list_transaction_tag_names( &self, ) -> Result<Vec<String>, ServerError>

Source

pub async fn list_transaction_tag_values( &self, tag_name: &str, ) -> Result<Vec<String>, ServerError>

Source

pub async fn create_split_tag( &self, split_id: Uuid, name: String, value: String, description: Option<String>, ) -> Result<Uuid, ServerError>

Source

pub async fn create_account_tag( &self, account_id: Uuid, name: String, value: String, description: Option<String>, ) -> Result<Uuid, ServerError>

Source

pub async fn list_account_tag_names(&self) -> Result<Vec<String>, ServerError>

Source

pub async fn list_account_tag_values( &self, tag_name: &str, ) -> Result<Vec<String>, ServerError>

Source

pub async fn list_split_tag_names(&self) -> Result<Vec<String>, ServerError>

Source

pub async fn list_split_tag_values( &self, tag_name: &str, ) -> Result<Vec<String>, ServerError>

Source§

impl User

Source

pub async fn get_connection(&self) -> Result<PoolConnection<Postgres>, DBError>

Auto Trait Implementations§

§

impl Freeze for User

§

impl RefUnwindSafe for User

§

impl Send for User

§

impl Sync for User

§

impl Unpin for User

§

impl UnsafeUnpin for User

§

impl UnwindSafe for User

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
§

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

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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